X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=autorandr.py;h=e5ab42fdd0308695e720b6ada0415ccdd8751c0e;hb=b0257a2703e12139c14f524f502c1f27c99ae527;hp=bf552bc9113c3f15e69e2328f1f4b46a4c4a4dbc;hpb=72df46f8ab9f793c168160e48e37326608399f67;p=deb_pkgs%2Fautorandr.git diff --git a/autorandr.py b/autorandr.py index bf552bc..e5ab42f 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() @@ -1070,6 +1072,8 @@ def main(argv): options["--load"] = options["-l"] if "--load" in options: load_profile = options["--load"] + elif len(args) == 1: + load_profile = args[0] else: # Find the active profile(s) first, for the block script (See #42) current_profiles = []