sphinx-doc / sphinx-doc/sphinx-argparse

Named argument -h not explained in rendered documentation

Open
#38 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.