aerogear / charmil

The framework for building modular plugin based CLI's using Cobra and Golang
https://aerogear.github.io/charmil
Apache License 2.0
116 stars 13 forks source link

Examples builder that provides base command instead of specifying command as string etc. #218

Closed wtrocki closed 3 years ago

wtrocki commented 3 years ago

Feature or problem description

Provide examples string builder that provides ability to generate full example string of the command and append to existing examples. This will prevent typos and ensure standard way to build command examples - description + command + some extra flags etc.

Example

## List all artifacts for the default artifacts group
rhoas service-registry artifacts list

can be done using builder

flagutil.NewCmdExample(cmd, "List all artifacts for the default artifacts group", "list --page=4")
flagutil.NewCmdExample(cmd, "List all artifacts", "list")
wtrocki commented 3 years ago

This can be also used as form of acceptance testing of commands etc.

ankithans commented 3 years ago

great idea!!