wmllint: put off dryrun's verbosity check until after options are processed

Per discussion with Elvish Hunter on the forum. Having dryrun check for a
minimum verbosity level during the options for loop meant that -vd would
set the verbosity level to 1, while -dv would set it to 2.
This commit is contained in:
Groggy Dice 2014-05-15 03:52:09 -04:00
parent cc059b64f6
commit ec3c65d4c1

View file

@ -2654,7 +2654,6 @@ if __name__ == '__main__':
clean = True
elif switch in ('-d', '--dryrun'):
dryrun = True
verbose = max(1, verbose)
elif switch in ('-D', '--diffs'):
diffs = True
elif switch in ('-f', '--future'):
@ -2673,6 +2672,8 @@ if __name__ == '__main__':
dospellcheck = False
elif switch in ('-K', '--known'):
inconsistency = True
if dryrun:
verbose = max(1, verbose)
if clean and revert:
sys.stderr.write("wmllint: can't do clean and revert together.\n")
sys.exit(1)