canonical / craft-cli

https://canonical-craft-cli.readthedocs-hosted.com/en/latest/
GNU Lesser General Public License v3.0
9 stars 15 forks source link

The help produced for a command options should give more information #132

Open facundobatista opened 1 year ago

facundobatista commented 1 year ago

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...

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.