How to preserve newlines in argparse version output while letting argparse auto-format/wrap the remaining help message?
<p>I wrote the following code.</p>

<pre><code>import argparse

parser = argparse.ArgumentParser()
parser.add_argument('-v', '--version', action='version',
                    version='%(prog)s 1.0\nCopyright (c) 2016 Lone Learner')
parser.parse_args()
</code></pre>

<p>This produces the following output.</p>

<pre><code>$ python foo.py --version
foo.py 1.0 Copyright (c) 2016 Lone Learner
</code></pre>

<p>You can see that the newline is lost. I wanted the copyright notice to appear on the next line.</p>

<p>How can I preserve the new lines in the version output message?</p>

<p>I still want argparse to compute how the output of <code>python foo.py -h</code> should be laid out with all the auto-wrapping it does. But I want the version output to be a multiline output with the newlines intact.</p>