config: add paths command to show configured paths

See #5591
This commit is contained in:
albertony 2021-09-10 14:42:57 +02:00
parent d8886b37a6
commit 352f9bcd47

View File

@ -23,6 +23,7 @@ func init() {
configCommand.AddCommand(configEditCommand)
configCommand.AddCommand(configFileCommand)
configCommand.AddCommand(configTouchCommand)
configCommand.AddCommand(configPathsCommand)
configCommand.AddCommand(configShowCommand)
configCommand.AddCommand(configDumpCommand)
configCommand.AddCommand(configProvidersCommand)
@ -73,6 +74,17 @@ var configTouchCommand = &cobra.Command{
},
}
var configPathsCommand = &cobra.Command{
Use: "paths",
Short: `Show paths used for configuration, cache, temp etc.`,
Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(0, 0, command, args)
fmt.Printf("Config file: %s\n", config.GetConfigPath())
fmt.Printf("Cache dir: %s\n", config.CacheDir)
fmt.Printf("Temp dir: %s\n", os.TempDir())
},
}
var configShowCommand = &cobra.Command{
Use: "show [<remote>]",
Short: `Print (decrypted) config file, or the config for a single remote.`,