summary refs log tree commit diff stats
path: root/compiler/commands.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-12-11 22:14:08 +0100
committerGitHub <noreply@github.com>2018-12-11 22:14:08 +0100
commitc58f430e2e7d393a65f80f4ee622c385f7641a1b (patch)
treea0155669ac6ef9230d152c8dd035292f816d2884 /compiler/commands.nim
parente3d91a5b748e9871fc952b6a6bcd91a2cfca2cb2 (diff)
parent9d10278a9ca0d90a5fe82fa6e7dfb7d7dcb0f38a (diff)
downloadNim-c58f430e2e7d393a65f80f4ee622c385f7641a1b.tar.gz
Merge pull request #9916 from timotheecour/pr_ref_9906_errorMax
refs #9906; --errorMax:10 allows stopping after 10 errors (more robust than nim check)
Diffstat (limited to 'compiler/commands.nim')
-rw-r--r--compiler/commands.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index b5bcfabc5..b962e8f39 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -617,6 +617,15 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
   of "run", "r":
     expectNoArg(conf, switch, arg, pass, info)
     incl(conf.globalOptions, optRun)
+  of "errormax":
+    expectArg(conf, switch, arg, pass, info)
+    conf.errorMax = block:
+      # Note: `nim check` (etc) can overwrite this.
+      # `0` is meaningless, give it a useful meaning as in clang's -ferror-limit
+      # If user doesn't set this flag and the code doesn't either, it'd
+      # have the same effect as errorMax = 1
+      let ret = parseInt(arg)
+      if ret == 0: high(int) else: ret
   of "verbosity":
     expectArg(conf, switch, arg, pass, info)
     let verbosity = parseInt(arg)