summary refs log tree commit diff stats
path: root/compiler/commands.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-06-26 18:33:51 +0200
committerGitHub <noreply@github.com>2018-06-26 18:33:51 +0200
commit2a3a128e362929bac9c2dbf7430cbe8732840f95 (patch)
treeac794774866b8b71c5a6e271a21b42b060b57900 /compiler/commands.nim
parente129466910b6efa730f8d5d9232efbce6dae46f0 (diff)
parentd08b9eb6731a70504be6d856723fbc94dc7bd506 (diff)
downloadNim-2a3a128e362929bac9c2dbf7430cbe8732840f95.tar.gz
Merge branch 'devel' into typedesc-reforms
Diffstat (limited to 'compiler/commands.nim')
-rw-r--r--compiler/commands.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index 330504a76..866405f9f 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -606,7 +606,10 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
     incl(conf.globalOptions, optRun)
   of "verbosity":
     expectArg(conf, switch, arg, pass, info)
-    conf.verbosity = parseInt(arg)
+    let verbosity = parseInt(arg)
+    if verbosity notin {0..3}:
+      localError(conf, info, "invalid verbosity level: '$1'" % arg)
+    conf.verbosity = verbosity
     conf.notes = NotesVerbosity[conf.verbosity]
     incl(conf.notes, conf.enableNotes)
     excl(conf.notes, conf.disableNotes)