]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
getopt: save args
authorChristoph Gysin <christoph.gysin@gmail.com>
Sun, 5 Nov 2017 21:26:49 +0000 (23:26 +0200)
committerChristoph Gysin <christoph.gysin@gmail.com>
Sun, 5 Nov 2017 21:37:15 +0000 (23:37 +0200)
autorandr.py

index bf552bc9113c3f15e69e2328f1f4b46a4c4a4dbc..119500bd1cbc73b18c167635ddaeb3523fd9b2dc 100755 (executable)
@@ -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()