diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2018-06-25 17:08:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 17:08:12 +0100 |
commit | 27b081d1f77604ee47c886e69dbc52f53ea3741f (patch) | |
tree | 42e28a34d0c43063488f23e81bf619ebd7931ced | |
parent | 193def6dcb96479c2e1f1e017e0ac38716d7ad23 (diff) | |
parent | 589d6bc8d81408df88298dd6cd3ee176d4bdbc46 (diff) | |
download | Nim-27b081d1f77604ee47c886e69dbc52f53ea3741f.tar.gz |
Merge pull request #8117 from LemonBoy/cmd-verbosity-level
Warn the user if the specified verbosity level is wrong
-rw-r--r-- | compiler/commands.nim | 5 |
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) |