1
0

fix -v syntax

After the introduction of arguments for -v, it would sometimes incorrectly consume the CLI cmd as its argument.
This change keeps the old "-v" syntax working, at the cost of having to provide the arguments without a whitespace directly after -v (and the args need to be single letters).
This commit is contained in:
SomberNight
2018-08-30 18:34:04 +02:00
parent aac7a34405
commit 6ee689345f
2 changed files with 9 additions and 1 deletions

View File

@@ -335,6 +335,14 @@ if __name__ == '__main__':
sys.argv.remove('help')
sys.argv.append('-h')
# old '-v' syntax
try:
i = sys.argv.index('-v')
except ValueError:
pass
else:
sys.argv[i] = '-v*'
# read arguments from stdin pipe and prompt
for i, arg in enumerate(sys.argv):
if arg == '-':