nixos-rebuild-ng: prevent Man from opening in some cases (#539282)

This commit is contained in:
Thiago Kenji Okada
2026-07-13 11:18:53 +00:00
committed by GitHub
@@ -240,7 +240,7 @@ def parse_args(
}
)
if args.help or args.action is None:
if args.help:
if WITH_SHELL_FILES:
r = run(["man", "8", EXECUTABLE], check=False)
parser.exit(r.returncode)
@@ -248,6 +248,11 @@ def parse_args(
parser.print_help()
parser.exit()
if args.action is None:
parser.error(
f"No valid subcommands. Type {parser.prog} --help for more information"
)
def parser_warn(msg: str) -> None:
print(f"{parser.prog}: warning: {msg}", file=sys.stderr)