Skip to content

Commit

Permalink
fix: remove env vars from config list output
Browse files Browse the repository at this point in the history
- provide complete help text for the command.
- close #4395
  • Loading branch information
frrist committed Sep 10, 2024
1 parent 1ca678c commit 0b0a84e
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions cmd/cli/config/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/bacalhau-project/bacalhau/cmd/util/flags/cliflags"
"github.com/bacalhau-project/bacalhau/cmd/util/hook"
"github.com/bacalhau-project/bacalhau/cmd/util/output"
"github.com/bacalhau-project/bacalhau/pkg/config"
"github.com/bacalhau-project/bacalhau/pkg/config/types"
)

Expand All @@ -23,8 +22,13 @@ func newListCmd() *cobra.Command {
Wide: false,
}
listCmd := &cobra.Command{
Use: "list",
Short: "List all config keys.",
Use: "list",
Short: "List all config keys and their descriptions",
Long: `The config list command displays all available configuration keys along with their detailed descriptions.
This comprehensive list helps you understand the settings you can adjust to customize the bacalhau's behavior.
Each key shown can be used with:
- bacalhau config set <key> <value> to directly set the value
- bacalhau --config=<key>=<value> to temporarily modify the setting for a single command execution`,
Args: cobra.MinimumNArgs(0),
PreRunE: hook.ClientPreRunHooks,
PostRunE: hook.ClientPostRunHooks,
Expand All @@ -38,7 +42,6 @@ func newListCmd() *cobra.Command {

type configListEntry struct {
Key string
EnvVar string
Description string
}

Expand All @@ -51,7 +54,6 @@ func list(cmd *cobra.Command, o output.OutputOptions) error {
for key, description := range types.ConfigDescriptions {
cfgList = append(cfgList, configListEntry{
Key: key,
EnvVar: config.KeyAsEnvVar(key),
Description: description,
})
}
Expand All @@ -70,12 +72,6 @@ var listColumns = []output.TableColumn[configListEntry]{
return s.Key
},
},
{
ColumnConfig: table.ColumnConfig{Name: "Environment Variable", WidthMax: 80, WidthMaxEnforcer: text.WrapHard},
Value: func(v configListEntry) string {
return fmt.Sprintf("%v", v.EnvVar)
},
},
{
ColumnConfig: table.ColumnConfig{Name: "Description", WidthMax: 80, WidthMaxEnforcer: text.WrapText},
Value: func(v configListEntry) string {
Expand Down

0 comments on commit 0b0a84e

Please sign in to comment.