nixos-rebuild-ng: move check for missing action argument earlier

This commit is contained in:
Thiago Kenji Okada
2024-11-30 17:54:32 +00:00
parent b118371ebb
commit cab7882bf5
@@ -122,6 +122,10 @@ def parse_args(
if args.ask_sudo_password:
args.sudo = True
if args.help or args.action is None:
r = run(["man", "8", "nixos-rebuild"], check=False)
parser.exit(r.returncode)
# TODO: use deprecated=True in Python >=3.13
if args.install_grub:
parser_warn("--install-grub deprecated, use --install-bootloader instead")
@@ -154,10 +158,6 @@ def parse_args(
if args.flake and (args.file or args.attr):
parser.error("--flake cannot be used with --file or --attr")
if args.help or args.action is None:
r = run(["man", "8", "nixos-rebuild"], check=False)
parser.exit(r.returncode)
return args, args_groups