[issue22240] argparse support for "python -m module" in help

Samuel Marks report at bugs.python.org
Fri Oct 4 23:43:23 EDT 2019


Samuel Marks <samuelmarks at gmail.com> added the comment:

Until this is accepted, I've modified my codebase:
```
from argparse import ArgumentParser

ArgumentParser(
  prog=None if globals().get('__spec__') is None else 'python -m {}'.format(__spec__.name.partition('.')[0])
)
```

----------
nosy: +samuelmarks

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22240>
_______________________________________


More information about the Python-bugs-list mailing list