You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the platform module's CLI is fairly hidden and inaccessible. I think there are two main issues with the module CLI.
There is no "Command Line Interface" section of the docs like there is with some other modules e.g. random. (It is, however, listed under the Modules command-line interface section)
There is no help section when running the platform CLI, the CLI takes two arguments --terse and --nonaliased, which I could only find from looking at the source in Lib/platform.py.
I am open to adding the missing documentation/ updating the CLI to use argparse for a help section. I came across this while looking into #131178, so it might be possible to add tests and update the CLI at the same time if this proposal is acceptable.
Activity
Harry-Lees commentedon Mar 20, 2025
I am open to adding the missing documentation/ updating the CLI to use argparse for a help section. I came across this while looking into #131178, so it might be possible to add tests and update the CLI at the same time if this proposal is acceptable.
sobolevn commentedon Mar 21, 2025
In my opinion, this is a good idea. I also think that we can add better CLI tools for arg parsing (like
argparse).CC @hugovk
donbarbos commentedon Mar 21, 2025
we also don't have help messages for many other CLI modules that parse flags themselves or use legacy modules to implement cli
I wrote about it here: #93096 (comment)
as already said (in comment) this makes the behavior implicit maybe it's worth opening a new issue to add help flags to each module
hugovk commentedon Mar 21, 2025
Interestingly, the CLI has been part of the module since it was added in 2003 for Python 2.3 and hasn't changed (beyond
printand whitespace): 246d847Fine by me too.
@Harry-Lees Would you like to open a PR?
gh-131524: Update platform CLI to use argparse (#131542)
pythongh-131524: Update platform CLI to use argparse (python#131542)