From 97e9a645b5a686706f20722a183b9b8e0af48c60 Mon Sep 17 00:00:00 2001 From: Youngjin Jo Date: Fri, 29 Nov 2024 02:48:38 +0900 Subject: [PATCH] refactor: change config command to settings Signed-off-by: Youngjin Jo --- cmd/other/config.go | 32 ++++++++++++++++---------------- cmd/root.go | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cmd/other/config.go b/cmd/other/config.go index 569f967..2209f83 100644 --- a/cmd/other/config.go +++ b/cmd/other/config.go @@ -27,19 +27,19 @@ import ( "gopkg.in/yaml.v2" ) -// ConfigCmd represents the config command -var ConfigCmd = &cobra.Command{ - Use: "config", - Short: "Manage cfctl configuration files", - Long: `Manage configuration files for cfctl. You can initialize, +// SettingsCmd represents the settings command +var SettingsCmd = &cobra.Command{ + Use: "settings", + Short: "Manage cfctl settings files", + Long: `Manage settings files for cfctl. You can initialize, switch environments, and display the current configuration.`, } -// configInitCmd initializes a new environment configuration -var configInitCmd = &cobra.Command{ +// settingsInitCmd initializes a new environment configuration +var settingsInitCmd = &cobra.Command{ Use: "init", - Short: "Initialize a new environment configuration", - Long: `Initialize a new environment configuration for cfctl by specifying either a URL or a local environment name.`, + Short: "Initialize a new environment settings", + Long: `Initialize a new environment settings for cfctl by specifying either a URL or a local environment name.`, } // configInitURLCmd initializes configuration with a URL @@ -1102,14 +1102,14 @@ func init() { configPath := filepath.Join(configDir, "config.yaml") cacheConfigPath := filepath.Join(configDir, "cache", "config.yaml") - ConfigCmd.AddCommand(configInitCmd) - ConfigCmd.AddCommand(envCmd) - ConfigCmd.AddCommand(showCmd) - ConfigCmd.AddCommand(configEndpointCmd) - configInitCmd.AddCommand(configInitURLCmd) - configInitCmd.AddCommand(configInitLocalCmd) + SettingsCmd.AddCommand(settingsInitCmd) + SettingsCmd.AddCommand(envCmd) + SettingsCmd.AddCommand(showCmd) + SettingsCmd.AddCommand(configEndpointCmd) + settingsInitCmd.AddCommand(configInitURLCmd) + settingsInitCmd.AddCommand(configInitLocalCmd) - configInitCmd.Flags().StringP("environment", "e", "", "Override environment name") + settingsInitCmd.Flags().StringP("environment", "e", "", "Override environment name") configInitURLCmd.Flags().StringP("url", "u", "", "URL for the environment") configInitURLCmd.Flags().Bool("app", false, fmt.Sprintf("Initialize as application configuration (config stored at %s)", configPath)) diff --git a/cmd/root.go b/cmd/root.go index 55213ac..58fb1a0 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -72,7 +72,7 @@ func init() { } rootCmd.AddGroup(OtherCommands) rootCmd.AddCommand(other.ApiResourcesCmd) - rootCmd.AddCommand(other.ConfigCmd) + rootCmd.AddCommand(other.SettingsCmd) rootCmd.AddCommand(other.LoginCmd) // Set default group for commands without a group