FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-131524: Update platform CLI to use argparse by Harry-Lees · Pull Request #131542 · python/cpython · GitHub

/ cpython Public

gh-131524: Update platform CLI to use argparse - #131542

Merged
hugovk merged 17 commits into
python:mainfrom
Harry-Lees:131524-patch-1
May 3, 2025
Merged

gh-131524: Update platform CLI to use argparse#131542
hugovk merged 17 commits into
python:mainfrom
Harry-Lees:131524-patch-1

Conversation

Harry-Lees commented Mar 21, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

Closes: #131524
Related To: #131178

This PR updates the platform CLI to use argparse which adds --help flags and a usage section which was previously unavailable.

Comment thread Lib/platform.py Outdated
Comment thread Lib/platform.py Outdated

sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

And don't forget about a NEWS entry :)

sobolevn requested a review from hugovk March 21, 2025 17:43

hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We now have help which shows the arguments:

./python.exe -m platform -h
usage: python.exe -m platform [-h] [--terse] [--nonaliased] [{nonaliased,terse} ...]

positional arguments:
  {nonaliased,terse}

options:
  -h, --help          show this help message and exit
  --terse
  --nonaliased

But doesn't say what they do. Please can you add short descriptions?

Comment thread Lib/test/test_platform.py
Comment thread Lib/test/test_platform.py
Harry-Lees and others added 4 commits March 21, 2025 22:41
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

Copy link
Copy Markdown
Contributor Author

But doesn't say what they do. Please can you add short descriptions?

The help message now gives a short description of each flag

usage: python.exe -m platform [-h] [--terse] [--nonaliased] [{nonaliased,terse} ...]

positional arguments:
  {nonaliased,terse}

options:
  -h, --help          show this help message and exit
  --terse             return only the absolute minimum information needed to identify the platform
  --nonaliased        disable system/ OS name aliasing. If aliasing is enabled, some platforms will report system names which differ from their common names, e.g. SunOS will be reported
                      as Solaris

Harry-Lees requested a review from hugovk March 21, 2025 23:11
Comment thread Lib/platform.py
Comment thread Lib/test/test_platform.py Outdated
Comment thread Lib/test/test_platform.py Outdated
Comment thread Lib/test/test_platform.py Outdated
Comment thread Lib/test/test_platform.py
Comment thread Lib/test/test_platform.py Outdated
Comment thread Lib/test/test_platform.py Outdated
Comment thread Lib/test/test_platform.py Outdated
Harry-Lees and others added 5 commits March 23, 2025 12:42
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Comment thread Lib/test/test_platform.py Outdated
Comment thread Lib/test/test_platform.py Outdated
Comment thread Lib/test/test_platform.py
Comment thread Lib/test/test_platform.py Outdated
Comment thread Lib/platform.py Outdated
Comment thread Lib/platform.py Outdated
Comment thread Lib/test/test_platform.py Outdated
Comment thread Lib/test/test_platform.py Outdated
Comment thread Lib/platform.py Outdated
Comment thread Lib/platform.py Outdated

Copy link
Copy Markdown
Contributor

Maybe it's worth adding a Command-line Usage section to the platform documentation?

hugovk commented May 3, 2025

Copy link
Copy Markdown
Member

Maybe it's worth adding a Command-line Usage section to the platform documentation?

This can be a followup PR.

hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

hugovk commented May 3, 2025

Copy link
Copy Markdown
Member

@donbarbos GitHub says you requested changes, is there anything outstanding on this PR?

donbarbos left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

sorry, I thought I was only leaving comments

hugovk enabled auto-merge (squash) May 3, 2025 08:55
hugovk merged commit 77c391a into python:main May 3, 2025
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve platform CLI

5 participants


Back | FazBrowse Home | New Git URL