Commit 2b2b425d authored by W. Trevor King's avatar W. Trevor King
Browse files

igor.script: Replace ArgumentParser(version=...) with a version argument

ArgumentParser lost its undocumented version argument in 3.3.0
[1,2,3].  The version action is the documented way to do this [4].

[1]: http://bugs.python.org/issue13248
[2]: https://hg.python.org/cpython/rev/5393382c1b1d
[3]: https://hg.python.org/cpython/file/374f501f4567/Misc/HISTORY#l477
[4]: https://docs.python.org/3/library/argparse.html#action
parent 2c2a79d8
......@@ -36,8 +36,10 @@ class Script (object):
log_levels = [_logging.ERROR, _logging.WARNING, _logging.INFO, _logging.DEBUG]
def __init__(self, description=None, filetype='IGOR Binary Wave (.ibw) file'):
self.parser = _argparse.ArgumentParser(
description=description, version=__version__)
self.parser = _argparse.ArgumentParser(description=description)
self.parser.add_argument(
'--version', action='version',
version='%(prog)s {}'.format(__version__))
self.parser.add_argument(
'-f', '--infile', metavar='FILE', default='-',
help='input {}'.format(filetype))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment