sphinx-doc / sphinx-doc/sphinx-argparse
Named argument -h not explained in rendered documentation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 38
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
Problem description:
The rendered documentation of a certain command looks as follows:
sample apply [-h] [-r] [--tree] [--dry] [--force] path default_string
Positional Arguments
path
Specify path to provision script. provision.py in current directory by default. Also may include url.
Default: “provision.py”
default_string
Ensure variables are filled in (default “I am a default”)
Default: “I am a default”
Named Arguments
-r, --rollback
If specified will rollback all resources applied.
Default: False
--tree
Print resource tree
Default: False
--dry
Just print changes list
Default: False
--force
Apply without confirmation
Default: False
Every argument is documented except for the -h option. This option just displays the help message, but this is not clear from the rendered documentation. In many command line tools, for example, -h is an abbreviation for --host, indicating the host to which the tool should connect.
Proposal:
I don't think there is a need to mention the -h option in the list of named arguments over and over again for every command. The meaning of the long version of this option, --help, is very well known in general. So replacing -h with --help in the signature of the command would already resolve this problem.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation file or test is named. Start by tracing how argparse command signatures are rendered in the Sphinx extension, then reproduce the shown documentation for a command with the built-in help option. Done means the signature presents --help instead of an unexplained -h while the other named arguments remain documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100