1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2025-04-04 04:29:35 +00:00

Clean up ArgumentParser usage message, add --version argument.

This commit is contained in:
Chris Pressey 2019-04-10 10:42:50 +01:00
parent 21a187a105
commit 652ab1dc5c

View File

@ -1,10 +1,5 @@
#!/usr/bin/env python
"""Usage: sixtypical [OPTIONS] FILES
Analyzes and compiles a Sixtypical program.
"""
from os.path import realpath, dirname, join
import sys
@ -92,7 +87,7 @@ def process_input_files(filenames, options):
if __name__ == '__main__':
argparser = ArgumentParser(__doc__.strip())
argparser = ArgumentParser()
argparser.add_argument(
'filenames', metavar='FILENAME', type=str, nargs='+',
@ -152,6 +147,11 @@ if __name__ == '__main__':
action="store_true",
help="When an error occurs, display a full Python traceback."
)
argparser.add_argument(
"--version",
action="version",
version="%(prog)s 0.19"
)
options, unknown = argparser.parse_known_args(sys.argv[1:])
remainder = ' '.join(unknown)