canonical / canonical/craft-cli

The help produced for a command options should give more information

Open
#132 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
16
Forks
27
Avg merge
2d 1h
Merged PRs (30d)
12

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.