mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 14:25:23 +00:00
Follow the documentation's recommendation (#10808)
The doc states "Make sure to pass options explicitly.", but the example didn't. Since constructing a string for the shell with appropriate quotes is non-trivial, the first example should be how to use `execProcess` including `args`
This commit is contained in:
committed by
Andreas Rumpf
parent
5c201791b3
commit
1a13b3a14e
@@ -97,7 +97,8 @@ proc execProcess*(command: string,
|
||||
## Example:
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## let outp = execProcess("nim c -r mytestfile.nim")
|
||||
## let outp = execProcess("/usr/bin/env", ["nim", "c", "-r", "mytestfile.nim"], option={})
|
||||
## let outp_shell = execProcess("nim c -r mytestfile.nim")
|
||||
## # Note: outp may have an interleave of text from the nim compile
|
||||
## # and any output from mytestfile when it runs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user