aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/cmd/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/go/cmd/config.go')
-rw-r--r--client/go/cmd/config.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/client/go/cmd/config.go b/client/go/cmd/config.go
index 3753d9a9390..863f247bd7c 100644
--- a/client/go/cmd/config.go
+++ b/client/go/cmd/config.go
@@ -34,8 +34,16 @@ func init() {
}
var configCmd = &cobra.Command{
- Use: "config",
- Short: "Configure default values for flags",
+ Use: "config",
+ Short: "Configure persistent values for flags",
+ Long: `Configure persistent values for flags.
+
+This command allows setting a persistent value for a given flag. On future
+invocations the flag can then be omitted as it is read from the config file
+instead.
+
+Configuration is written to $HOME/.vespa by default. This path can be
+overridden by setting the VESPA_CLI_HOME environment variable.`,
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
// Root command does nothing
@@ -100,16 +108,8 @@ type Config struct {
}
func LoadConfig() (*Config, error) {
- home := os.Getenv("VESPA_CLI_HOME")
- if home == "" {
- var err error
- home, err = os.UserHomeDir()
- if err != nil {
- return nil, err
- }
- home = filepath.Join(home, ".vespa")
- }
- if err := os.MkdirAll(home, 0700); err != nil {
+ home, err := vespaCliHome()
+ if err != nil {
return nil, err
}
c := &Config{Home: home, createDirs: true}