From ed4eab647ab041a22ba25bec0a115e5f66a5a543 Mon Sep 17 00:00:00 2001 From: Christoph Gysin Date: Sun, 5 Nov 2017 23:26:49 +0200 Subject: [PATCH] getopt: save args --- autorandr.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autorandr.py b/autorandr.py index bf552bc..119500b 100755 --- a/autorandr.py +++ b/autorandr.py @@ -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() -- 2.39.2