aboutsummaryrefslogtreecommitdiffhomepage
path: root/janet.1
diff options
context:
space:
mode:
authorTechcable <Techcable@techcable.net>2022-08-18 12:16:14 -0700
committerTechcable <Techcable@techcable.net>2022-08-18 12:16:14 -0700
commitdbac495bee131c5bfac23e8ff8d9a4c9bf50ba37 (patch)
tree71005e09d559c05ff075e9b7580e17449ec24656 /janet.1
parentMerge branch 'master' of github.com:janet-lang/janet (diff)
Clarify the documentation of janet -E flag
This confused me, despite having a fair deal of janet experience.
Diffstat (limited to 'janet.1')
-rw-r--r--janet.17
1 files changed, 6 insertions, 1 deletions
diff --git a/janet.1 b/janet.1
index 2bb8560a..0557ada3 100644
--- a/janet.1
+++ b/janet.1
@@ -164,10 +164,15 @@ Execute a string of Janet source. Source code is executed in the order it is enc
arguments are executed before later ones.
.TP
-.BR \-E\ code arguments
+.BR \-E\ code\ arguments...
Execute a single Janet expression as a Janet short-fn, passing the remaining command line arguments to the expression. This allows
more concise one-liners with command line arguments.
+Example: janet -E '(print $0)' 12 is equivalent to '((short-fn (print $0)) 12)', which is in turn equivalent to
+`((fn [k] (print k)) 12)`
+
+See docs for the `short-fn` function for more details.
+
.TP
.BR \-d
Enable debug mode. On all terminating signals as well the debug signal, this will