diff --git a/docs/commands.md b/docs/commands.md index 6316aee0..345f8842 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -2,6 +2,10 @@ These are commands usable from a CBQN REPL that, for one reason or another, aren't suited to be system functions. +## `)exit` / `)off` + +Equivalent to `•Exit 0` + ## `)ex path/to/file` Execute the contents of the file as if it were REPL input (but allowing multiline definitions). Not a system function because modifying the list of global variables during execution is not allowed. diff --git a/src/main.c b/src/main.c index 703ca577..a77bc859 100644 --- a/src/main.c +++ b/src/main.c @@ -592,6 +592,8 @@ void cbqn_runLine0(char* ln, i64 read) { else printf("Unknown theme\n"); return; #endif + } else if (isCmd(cmdS, &cmdE, "exit") || isCmd(cmdS, &cmdE, "off")) { + bqn_exit(0); } else if (isCmd(cmdS, &cmdE, "vars")) { B r = listVars(gsc); if (q_N(r)) {