Skip to content

Commit

Permalink
Better help texts
Browse files Browse the repository at this point in the history
  • Loading branch information
phm07 committed May 3, 2024
1 parent 443ba9f commit 7b9881f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions internal/cmd/config/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func NewAddCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "add <key> <value>...",
Short: "Add values to a list",
Long: "Add values to a list. For a list of all available configuration options, run 'hcloud help config'.",
Args: util.Validate,
TraverseChildren: true,
DisableFlagsInUseLine: true,
Expand Down
13 changes: 10 additions & 3 deletions internal/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@ func NewCommand(s state.State) *cobra.Command {
Use: "config",
Short: "Manage configuration",
Long: `This command allows you to manage options for the Hetzner Cloud CLI. Options can be set inside the
configuration file, through environment variables or with flags. Most options are 'preferences' -
these options can be set globally and can additionally be overridden for each context.
configuration file, through environment variables or with flags.
Below is a list of all non-preference options:
The hierarchy for configuration sources is as follows (from highest to lowest priority):
1. Flags
2. Environment variables
3. Configuration file (context)
4. Configuration file (global)
5. Default values
Most options are 'preferences' - these options can be set globally and can additionally be overridden
for each context. Below is a list of all non-preference options:
` + nonPreferenceOptions +
`
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/config/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func NewGetCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "get <key>",
Short: "Get a configuration value",
Long: "Get a configuration value. For a list of all available configuration options, run 'hcloud help config'.",
Args: util.Validate,
TraverseChildren: true,
DisableFlagsInUseLine: true,
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/config/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func NewRemoveCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "remove <key> <value>...",
Short: "Remove values from a list",
Long: "Remove values from a list. For a list of all available configuration options, run 'hcloud help config'.",
Args: util.Validate,
TraverseChildren: true,
DisableFlagsInUseLine: true,
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/config/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func NewSetCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "set <key> <value>...",
Short: "Set a configuration value",
Long: "Set a configuration value. For a list of all available configuration options, run 'hcloud help config'.",
Args: util.Validate,
TraverseChildren: true,
DisableFlagsInUseLine: true,
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/config/unset.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func NewUnsetCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "unset <key>",
Short: "Unset a configuration value",
Long: "Unset a configuration value. For a list of all available configuration options, run 'hcloud help config'.",
Args: util.Validate,
TraverseChildren: true,
DisableFlagsInUseLine: true,
Expand Down

0 comments on commit 7b9881f

Please sign in to comment.