mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-91818: Use default program name in the CLI of many modules (GH-124867)
As argparse now detects by default when the code was run as a module. This leads to using the actual executable name instead of simply "python" to display in the usage message ("usage: python -m ...").
This commit is contained in:
parent
cbfd392479
commit
7d2c39752f
10 changed files with 14 additions and 12 deletions
|
@ -510,7 +510,7 @@ def main():
|
|||
sys.exit(1)
|
||||
|
||||
# Parse the arguments and options
|
||||
parser = argparse.ArgumentParser(prog='python -m tokenize')
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(dest='filename', nargs='?',
|
||||
metavar='filename.py',
|
||||
help='the file to tokenize; defaults to stdin')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue