summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJacek Sieka <arnetheduck@gmail.com>2019-03-04 03:49:56 -0600
committerAndreas Rumpf <rumpf_a@web.de>2019-03-04 10:49:55 +0100
commit7072e3ddca3ae794dd17e352279f70805278ba6d (patch)
tree6304d3c7df5560be6ed81c05ec1f05c6ed619036
parent1d9b88f25d8c278123133773f83fd9ce81685bac (diff)
downloadNim-7072e3ddca3ae794dd17e352279f70805278ba6d.tar.gz
doc: move specific checks to advanced options, for a less intimidatin… (#10779)
* doc: move specific checks to advanced options, for a less intimidating help

* remove useless bool
-rw-r--r--compiler/commands.nim6
-rw-r--r--compiler/nim.nim2
-rw-r--r--compiler/options.nim1
-rw-r--r--doc/advopt.txt12
-rw-r--r--doc/basicopt.txt11
5 files changed, 16 insertions, 16 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index abee4e9b2..583d2bb9e 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 5ca650789..982d0c7e5 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 037febc28..f3594ca11 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 b0c23e391..4dd710107 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 a65b2302e..aa6675dc8 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.