Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
May 3, 2025

Conversation

Harry-Lees
Copy link
Contributor

@Harry-Lees Harry-Lees commented Mar 21, 2025

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.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

And don't forget about a NEWS entry :)

@sobolevn sobolevn requested a review from hugovk March 21, 2025 17:43
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

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?

@Harry-Lees
Copy link
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 Harry-Lees requested a review from hugovk March 21, 2025 23:11
@donBarbos
Copy link
Contributor

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

@hugovk
Copy link
Member

hugovk commented May 3, 2025

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

This can be a followup PR.

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Thanks!

@hugovk
Copy link
Member

hugovk commented May 3, 2025

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

Copy link
Contributor

@donBarbos donBarbos left a comment

Choose a reason for hiding this comment

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

sorry, I thought I was only leaving comments

@hugovk hugovk enabled auto-merge (squash) May 3, 2025 08:55
@hugovk hugovk merged commit 77c391a into python:main May 3, 2025
43 checks passed
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