Skip to content

Commit

Permalink
refactor: change config command to settings
Browse files Browse the repository at this point in the history
Signed-off-by: Youngjin Jo <[email protected]>
  • Loading branch information
yjinjo committed Nov 28, 2024
1 parent 41323c3 commit 97e9a64
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions cmd/other/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97e9a64

Please sign in to comment.