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:
@@ -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 == '-':
|
||||
|
||||
Reference in New Issue
Block a user