Jake Hunsaker <jhuns...@redhat.com> added the comment:
Ah, ok - so I neglected to mention we're using subparsers which appears to be relevant here. My apologies. Here's a minimal reproducer that shows the behavior when using './arg_test.py foo --bar=on' ``` #! /bin/python3 import argparse usage_string = 'test usage string ending in newlines\n\n' sub_cmd_usage = '' for i in range(0, 3): sub_cmd_usage += '\tfoo --bar\n' usage_string += sub_cmd_usage parser = argparse.ArgumentParser(usage=usage_string) subparser = parser.add_subparsers(dest='subcmd', metavar='subcmd') subcmd_parser = subparser.add_parser('foo') subcmd_parser.add_argument('--bar', action="store_true", default=False) if __name__ == '__main__': args = parser.parse_args() ``` ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42297> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com