getopt: save args

This commit is contained in:
Christoph Gysin 2017-11-05 23:26:49 +02:00
parent c8c1f290db
commit ed4eab647a

View File

@ -955,13 +955,15 @@ def dispatch_call_to_sessions(argv):
def main(argv):
try:
options = dict(getopt.getopt(argv[1:], "s:r:l:d:cfh", ["batch", "dry-run", "change", "default=", "save=", "remove=", "load=", "force", "fingerprint", "config", "debug", "skip-options=", "help"])[0])
opts, args = getopt.getopt(argv[1:], "s:r:l:d:cfh", ["batch", "dry-run", "change", "default=", "save=", "remove=", "load=", "force", "fingerprint", "config", "debug", "skip-options=", "help"])
except getopt.GetoptError as e:
print("Failed to parse options: {0}.\n"
"Use --help to get usage information.".format(str(e)),
file=sys.stderr)
sys.exit(posix.EX_USAGE)
options = dict(opts)
if "-h" in options or "--help" in options:
exit_help()