From 352f9bcd47f4f7930f0b1564843aaee5aa1fa242 Mon Sep 17 00:00:00 2001 From: albertony <12441419+albertony@users.noreply.github.com> Date: Fri, 10 Sep 2021 14:42:57 +0200 Subject: [PATCH] config: add paths command to show configured paths See #5591 --- cmd/config/config.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmd/config/config.go b/cmd/config/config.go index 2aeacbad7..555ac7063 100644 --- a/cmd/config/config.go +++ b/cmd/config/config.go @@ -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 []", Short: `Print (decrypted) config file, or the config for a single remote.`,