Move init to 'config init', add config edit/get/set subcommands
The config command group manages the config file: config init - write default config (moved from top-level init) config edit - open the config in $EDITOR (falls back to vi) config get - print a value by dotted YAML path (s3.bucket) config set - set a scalar value by dotted YAML path get/set operate on the yaml.Node tree so comments and formatting in the config file are preserved across edits. set creates intermediate maps as needed.
This commit is contained in:
@@ -41,7 +41,7 @@ on the source system.`,
|
||||
|
||||
// Add subcommands
|
||||
cmd.AddCommand(
|
||||
NewInitCommand(),
|
||||
NewConfigCommand(),
|
||||
NewRestoreCommand(),
|
||||
NewPruneCommand(),
|
||||
NewStoreCommand(),
|
||||
@@ -78,7 +78,7 @@ func ResolveConfigPath() (string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("no config file found; run 'vaultik init' to create one, or specify with --config")
|
||||
return "", fmt.Errorf("no config file found; run 'vaultik config init' to create one, or specify with --config")
|
||||
}
|
||||
|
||||
// defaultConfigPaths returns the ordered list of config paths to search.
|
||||
|
||||
Reference in New Issue
Block a user