By default, the formatter will convert strings according to your terminal (it looks at the COLUMNS environment COLUMNS to determine the output width, by default no more than 80 characters).
In the formatter_class section:
By default, ArgumentParser objects wrap around epilog descriptions and texts in command line messages.
Use the RawTextHelpFormatter class instead to indicate that you have already wrapped the lines:
RawTextHelpFormatter supports spaces for all kinds of help text, including argument descriptions.
For your code, which will look like this:
parser = argparse.ArgumentParser(description='details', usage='use "%(prog)s --help" for more information', formatter_class=argparse.RawTextHelpFormatter)
Make sure that you do not add too many new lines; triple quotes include the lines you leave in the line. This way you do not need the \n characters:
>>> import argparse >>> parser = argparse.ArgumentParser(description='details', ... usage='use "%(prog)s --help" for more information', ... formatter_class=argparse.RawTextHelpFormatter) >>> parser.add_argument('--argument', default=None, ... help=''' ... First line ... Second line ... ... More lines ... ''') _StoreAction(option_strings=['--argument'], dest='argument', nargs=None, const=None, default=None, type=None, choices=None, help='\n First line\n Second line\n\n More lines\n ', metavar=None) >>> parser.print_help() usage: use " --help" for more information details optional arguments: -h, --help show this help message and exit --argument ARGUMENT First line Second line More lines