Python Argparse – How can I add text to the default help message?
You can quite do it using epilog. Here is an example below: import argparse import textwrap parser = argparse.ArgumentParser( prog=’ProgramName’, formatter_class=argparse.RawDescriptionHelpFormatter, epilog=textwrap.dedent(”’\ additional information: I have indented it exactly the way I want it ”’)) parser.add_argument(‘–foo’, nargs=”?”, help=’foo help’) parser.add_argument(‘bar’, nargs=”+”, help=’bar help’) parser.print_help() Result : usage: ProgramName [-h] [–foo [FOO]] bar [bar …] positional … Read more