From 97ad4c4f89705c59a9e41fba6be140e8a6307fd4 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 19 May 2019 15:20:59 -0400 Subject: [PATCH] Update manpage and make -k mode not exit on error. --- janet.1 | 6 +++++- src/mainclient/init.janet | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/janet.1 b/janet.1 index 2bf5ef1c..eb03a104 100644 --- a/janet.1 +++ b/janet.1 @@ -3,7 +3,7 @@ janet \- run the Janet language abstract machine .SH SYNOPSIS .B janet -[\fB\-hvsrpnq\fR] +[\fB\-hvsrpnqk\fR] [\fB\-e\fR \fISOURCE\fR] [\fB\-l\fR \fIMODULE\fR] [\fB\-m\fR \fIPATH\fR] @@ -67,6 +67,10 @@ after an error. Persistent mode can be good for debugging and testing. .BR \-q Quiet output. Don't print a repl prompt or expression results to stdout. +.TP +.BR \-k +Don't execute a script, only compile it to check for errors. Useful for linting scripts. + .TP .BR \-m\ syspath Set the variable module/*syspath* to the string syspath so that Janet will load system modules diff --git a/src/mainclient/init.janet b/src/mainclient/init.janet index 1ac7b8de..c24eb62c 100644 --- a/src/mainclient/init.janet +++ b/src/mainclient/init.janet @@ -39,7 +39,7 @@ "r" (fn [&] (set *should-repl* true) 1) "p" (fn [&] (set *exit-on-error* false) 1) "q" (fn [&] (set *quiet* true) 1) - "k" (fn [&] (set *compile-only* true) 1) + "k" (fn [&] (set *compile-only* true) (set *exit-on-error* false) 1) "n" (fn [&] (set *colorize* false) 1) "m" (fn [i &] (set module/*syspath* (get process/args (+ i 1))) 2) "c" (fn [i &]