summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-11-09 09:07:22 -0600
committerGitHub <noreply@github.com>2020-11-09 16:07:22 +0100
commitc1664f93b0024b558ff359f13ab6cd2e6c1b5cc7 (patch)
tree731b28344b508781f15872cfba44f09fc0bdae71 /doc
parent53eca459f1d96c710238be95bd3fb048b336f2f3 (diff)
downloadNim-c1664f93b0024b558ff359f13ab6cd2e6c1b5cc7.tar.gz
new: `nim -e:cmd` to run a command directly; also fixes #15731 (#15687)
* new: `nim -i cmd`
* rename -i to -e (for eval); consistent with majority of other programing languages
* `nim e -e:cmd` now works; bugfix: `echo cmd | nim e -` now works
* honor --betterRun
* address comments
* --eval alias for -e (replaces undocumented --eval which was a noop)
* --eval now defaults to e (nimscript) instead of r
* address comment: remove -e, only keep --eval
* address comment
* fixup
* Update compiler/nimconf.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'doc')
-rw-r--r--doc/basicopt.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/basicopt.txt b/doc/basicopt.txt
index 7ea55cf6c..a2db1c92e 100644
--- a/doc/basicopt.txt
+++ b/doc/basicopt.txt
@@ -31,6 +31,9 @@ Options:
   --app:console|gui|lib|staticlib
                             generate a console app|GUI app|DLL|static library
   -r, --run                 run the compiled program with given arguments
+  --eval:cmd                evaluates nim code directly; e.g.: `nim --eval:"echo 1"`
+                            defaults to `e` (nimscript) but customizable:
+                            `nim r --eval:'for a in stdin.lines: echo a'`
   --fullhelp                show all command line switches
   -h, --help                show this help
   -v, --version             show detailed version information