Hello Michaƫl,
in your PEP your wrote:
---
The standard library's ``argparse.ArgumentParser`` uses by default
``sys.argv[0]`` for his ``prog`` property.
It means that when using the ``python -m foobar`` invocation, which calls
under
the hood the ``foobar.__main__`` module, the ``prog`` will be
``__main__.py``,
giving as usage: ``usage: __main__.py [-h] ...``.
---
I did a quick check with the file `prog_name.py` which contained:
if __name__ == '__main__':
from argparse import ArgumentParser
ap = ArgumentParser(description='Test default prog name')
args = ap.parse_args()
then put it on PYTHONPATH and invoked it with:
python -m prog_name --help
and got the correct reply:
usage: prog_name.py [-h]
Test default prog name
optional arguments:
-h, --help show this help message and exit
I checked on Python 3.7.3 (Windows) and Python 2.7.13 (raspbian), on both
systems it behaves the same way.
In what environment exactly do you see the problem?
Richard
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/I5XMJ6DXLDIISQTMZ6B5OYEMRFETKGQR/
Code of Conduct: http://python.org/psf/codeofconduct/