diff --git a/compiler/commands.nim b/compiler/commands.nim index abee4e9b21..583d2bb9e7 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -102,10 +102,8 @@ proc writeVersionInfo(conf: ConfigRef; pass: TCmdLinePass) = {msgStdout}) msgQuit(0) -proc writeCommandLineUsage*(conf: ConfigRef; helpWritten: var bool) = - if not helpWritten: - msgWriteln(conf, getCommandLineDesc(conf), {msgStdout}) - helpWritten = true +proc writeCommandLineUsage*(conf: ConfigRef) = + msgWriteln(conf, getCommandLineDesc(conf), {msgStdout}) proc addPrefix(switch: string): string = if len(switch) == 1: result = "-" & switch diff --git a/compiler/nim.nim b/compiler/nim.nim index 5ca6507898..982d0c7e57 100644 --- a/compiler/nim.nim +++ b/compiler/nim.nim @@ -68,7 +68,7 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) = ) self.initDefinesProg(conf, "nim_compiler") if paramCount() == 0: - writeCommandLineUsage(conf, conf.helpWritten) + writeCommandLineUsage(conf) return self.processCmdLineAndProjectPath(conf) diff --git a/compiler/options.nim b/compiler/options.nim index 037febc284..f3594ca113 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -194,7 +194,6 @@ type features*: set[Feature] arguments*: string ## the arguments to be passed to the program that ## should be run - helpWritten*: bool ideCmd*: IdeCmd oldNewlines*: bool cCompiler*: TSystemCC diff --git a/doc/advopt.txt b/doc/advopt.txt index b0c23e391b..4dd710107f 100644 --- a/doc/advopt.txt +++ b/doc/advopt.txt @@ -16,6 +16,17 @@ Advanced commands: see also: --dump.format:json (useful with: ` | jq`) //check checks the project for syntax and semantic +Runtime checks (see -x): + --objChecks:on|off turn obj conversion checks on|off + --fieldChecks:on|off turn case variant field checks on|off + --rangeChecks:on|off turn range checks on|off + --boundChecks:on|off turn bound checks on|off + --overflowChecks:on|off turn int over-/underflow checks on|off + --floatChecks:on|off turn all floating point (NaN/Inf) checks on|off + --nanChecks:on|off turn NaN checks on|off + --infChecks:on|off turn Inf checks on|off + --nilChecks:on|off turn nil checks on|off + Advanced options: -o:FILE, --out:FILE set the output filename --outdir:DIR set the path where the output file will be written @@ -109,7 +120,6 @@ Advanced options: --errorMax:N stop compilation after N errors; 0 means unlimited --experimental:$1 enable experimental language feature - -v, --version show detailed version information --profiler:on|off Enable profiling; requires `import nimprof`, and works better with `--stackTrace:on` see also https://nim-lang.github.io/Nim/estp.html diff --git a/doc/basicopt.txt b/doc/basicopt.txt index a65b2302e5..aa6675dc8e 100644 --- a/doc/basicopt.txt +++ b/doc/basicopt.txt @@ -8,6 +8,7 @@ Command: Arguments: arguments are passed to the program being run (if --run option is selected) + Options: -p, --path:PATH add path to search paths -d, --define:SYMBOL(:VAL) @@ -20,16 +21,7 @@ Options: --lineTrace:on|off turn line tracing on|off --threads:on|off turn support for multi-threading on|off -x, --checks:on|off turn all runtime checks on|off - --objChecks:on|off turn obj conversion checks on|off - --fieldChecks:on|off turn case variant field checks on|off - --rangeChecks:on|off turn range checks on|off - --boundChecks:on|off turn bound checks on|off - --overflowChecks:on|off turn int over-/underflow checks on|off -a, --assertions:on|off turn assertions on|off - --floatChecks:on|off turn all floating point (NaN/Inf) checks on|off - --nanChecks:on|off turn NaN checks on|off - --infChecks:on|off turn Inf checks on|off - --nilChecks:on|off turn nil checks on|off --opt:none|speed|size optimize not at all or for speed|size Note: use -d:release for a release build! --debugger:native|endb use native debugger (gdb) | ENDB (experimental) @@ -38,5 +30,6 @@ Options: -r, --run run the compiled program with given arguments --fullhelp show all command line switches -h, --help show this help + -v, --version show detailed version information Note, single letter options that take an argument require a colon. E.g. -p:PATH.