← Back to issue list

The help produced for a command options should give more information

View original Github issue

Metadata

Project
craft-cli
Number
#132
Type
issue
State
open
Author
facundobatista
Labels
Created
2023-01-11 12:08:22+00:00
Updated
2023-01-18 15:49:55+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

Currently each option information for a command only states the option and the help message; see this output for a fake command as it's produced right now: ``` --name: Example of a parameter that expects one value --rank: Expects a value, but has a default -c, --confirm: This option just puts a flag in True -s, --stars: There may be one or more stars --planets: There may be zero or more planets --profile: Option that has choices ``` However, the `argparse` module shows more information: ``` --name NAME Example of a parameter that expects one value --rank RANK Expects a value, but has a default -c, --confirm This option just puts a flag in True -s [STARS], --stars [STARS] There may be one or more stars --planets [PLANETS ...] There may be zero or more planets --profile {simple,kubernetes,machine} Option that has choices ``` While I don't like the argparse output (at all), we could find a way to express that each parameter... - expects a value and it's not just a flag - has a default - may be used more than once (but at least one may be needed) - has some choices to select from Note that some of these combinations may happen (e.g. the command has choices and also a default). We need to define a way to express this information (or at least part of it) in a nice way, and then implement it.

Evaluation history

No evaluation history available.