From 7b9881fa26fe2bf41476020eed2f10a3f1700827 Mon Sep 17 00:00:00 2001 From: pauhull <22707808+phm07@users.noreply.github.com> Date: Fri, 3 May 2024 17:18:52 +0200 Subject: [PATCH] Better help texts --- internal/cmd/config/add.go | 1 + internal/cmd/config/config.go | 13 ++++++++++--- internal/cmd/config/get.go | 1 + internal/cmd/config/remove.go | 1 + internal/cmd/config/set.go | 1 + internal/cmd/config/unset.go | 1 + 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/internal/cmd/config/add.go b/internal/cmd/config/add.go index 92725361..5f5a9af1 100644 --- a/internal/cmd/config/add.go +++ b/internal/cmd/config/add.go @@ -16,6 +16,7 @@ func NewAddCommand(s state.State) *cobra.Command { cmd := &cobra.Command{ Use: "add ...", 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, diff --git a/internal/cmd/config/config.go b/internal/cmd/config/config.go index f1966881..7a0c1c9f 100644 --- a/internal/cmd/config/config.go +++ b/internal/cmd/config/config.go @@ -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 + ` diff --git a/internal/cmd/config/get.go b/internal/cmd/config/get.go index 7c7edffd..195dc6a8 100644 --- a/internal/cmd/config/get.go +++ b/internal/cmd/config/get.go @@ -14,6 +14,7 @@ func NewGetCommand(s state.State) *cobra.Command { cmd := &cobra.Command{ Use: "get ", 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, diff --git a/internal/cmd/config/remove.go b/internal/cmd/config/remove.go index 59b0126a..75e66bed 100644 --- a/internal/cmd/config/remove.go +++ b/internal/cmd/config/remove.go @@ -16,6 +16,7 @@ func NewRemoveCommand(s state.State) *cobra.Command { cmd := &cobra.Command{ Use: "remove ...", 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, diff --git a/internal/cmd/config/set.go b/internal/cmd/config/set.go index 57e5818f..1134b16c 100644 --- a/internal/cmd/config/set.go +++ b/internal/cmd/config/set.go @@ -15,6 +15,7 @@ func NewSetCommand(s state.State) *cobra.Command { cmd := &cobra.Command{ Use: "set ...", 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, diff --git a/internal/cmd/config/unset.go b/internal/cmd/config/unset.go index f4452684..f1e5f89b 100644 --- a/internal/cmd/config/unset.go +++ b/internal/cmd/config/unset.go @@ -16,6 +16,7 @@ func NewUnsetCommand(s state.State) *cobra.Command { cmd := &cobra.Command{ Use: "unset ", 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,