Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove env vars from config list output #4399

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading