summaryrefslogtreecommitdiffstatshomepage
path: root/unix/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/main.c')
-rw-r--r--unix/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/unix/main.c b/unix/main.c
index 4ba68dcb9b..dedee28e7f 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -474,9 +474,12 @@ MP_NOINLINE int main_(int argc, char **argv) {
const int NOTHING_EXECUTED = -2;
int ret = NOTHING_EXECUTED;
+ bool inspect = false;
for (int a = 1; a < argc; a++) {
if (argv[a][0] == '-') {
- if (strcmp(argv[a], "-c") == 0) {
+ if (strcmp(argv[a], "-i") == 0) {
+ inspect = true;
+ } else if (strcmp(argv[a], "-c") == 0) {
if (a + 1 >= argc) {
return usage(argv);
}
@@ -556,7 +559,7 @@ MP_NOINLINE int main_(int argc, char **argv) {
}
}
- if (ret == NOTHING_EXECUTED) {
+ if (ret == NOTHING_EXECUTED || inspect) {
if (isatty(0)) {
prompt_read_history();
ret = do_repl();