Actually, output help to stderr, as argparse itself does.

This commit is contained in:
Chris Berkhout 2021-05-27 20:15:01 +02:00
parent 9c64767ed1
commit a609a2b8c3

View file

@ -34,7 +34,7 @@ def cli(args=None, output_file=sys.stdout):
elif args.command == "fetch":
print(cmd_fetch(args), end="", file=output_file)
else:
parser.print_help(file=output_file)
parser.print_help(file=sys.stderr)
except BrokenPipeError:
logging.debug("The output pipe was closed early.")