index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-06-10 15:27:02 +0200 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2021-06-10 15:27:02 +0200 |
commit | 0946b73095dffe343f3ee8f622a565b77a6e8871 (patch) | |
tree | 116f2cddb95712aa0b11f2e9c6b0f43303840a3d /archinstall/__init__.py | |
parent | e8d38ea1a75a33d820ac32c995a80c1bc833a44d (diff) | |
parent | fcd0acfef261ad83f0d470957f94e6b046f66411 (diff) |
-rw-r--r-- | archinstall/__init__.py | 10 |
diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 0b799d5b..84595528 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -30,8 +30,11 @@ storage['__version__'] = __version__ def initialize_arguments(): config = {} parser.add_argument("--config", nargs="?", help="JSON configuration file or URL") + parser.add_argument("--creds", nargs="?", help="JSON credentials configuration file") parser.add_argument("--silent", action="store_true", - help="Warning!!! No prompts, ignored if config is not passed") + help="WARNING: Disables all prompts for input and confirmation. If no configuration is provided, this is ignored") + parser.add_argument("--dry-run", action="store_true", + help="Generates a configuration file and then exits instead of performing an installation") parser.add_argument("--script", default="guided", nargs="?", help="Script to run for installation", type=str) args, unknowns = parser.parse_known_args() if args.config is not None: @@ -47,6 +50,9 @@ def initialize_arguments(): config = json.loads(response.read()) except Exception as e: print(e) + if args.creds is not None: + with open(args.creds) as file: + config.update(json.load(file)) # Installation can't be silent if config is not passed config["silent"] = args.silent for arg in unknowns: @@ -57,6 +63,8 @@ def initialize_arguments(): key, val = arg[2:], True config[key] = val config["script"] = args.script + if args.dry_run is not None: + config["dry_run"] = args.dry_run return config |