summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2018-12-09 19:11:08 -0800
committerTimothee Cour <timothee.cour2@gmail.com>2018-12-09 19:11:08 -0800
commitdaaf50ae0383e4b8250cfca7cfe3cee27a0290d9 (patch)
tree28633c0b04617c408938c8df706b7f0113434044
parent606b43ba1130b5672e91ddd156d81267634ed465 (diff)
downloadNim-daaf50ae0383e4b8250cfca7cfe3cee27a0290d9.tar.gz
refs #9906; --errorMax:10 allows stopping after 10 errors
-rw-r--r--compiler/commands.nim5
-rw-r--r--doc/advopt.txt1
2 files changed, 6 insertions, 0 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index fa17e9851..576a7dc7f 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -617,6 +617,11 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
   of "run", "r":
     expectNoArg(conf, switch, arg, pass, info)
     incl(conf.globalOptions, optRun)
+  of "errormax":
+    # Note: `nim check` (etc) can overwrite this;
+    # `0` is meaningless and has same effect as `1`
+    expectArg(conf, switch, arg, pass, info)
+    conf.errorMax = parseInt(arg)
   of "verbosity":
     expectArg(conf, switch, arg, pass, info)
     let verbosity = parseInt(arg)
diff --git a/doc/advopt.txt b/doc/advopt.txt
index 7cd72f6c3..11af58392 100644
--- a/doc/advopt.txt
+++ b/doc/advopt.txt
@@ -103,6 +103,7 @@ Advanced options:
                             value = number of processors (0 for auto-detect)
   --incremental:on|off      only recompile the changed modules (experimental!)
   --verbosity:0|1|2|3       set Nim's verbosity level (1 is default)
+  --errorMax:int            stop after n (>=1) errors in semantic pass
   --experimental:$1
                             enable experimental language feature
   -v, --version             show detailed version information