nixos-rebuild-ng: prevent Man from opening in some cases (#539282)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user