Skip to content

Commit

Permalink
Merge pull request #58 from yjinjo/v0
Browse files Browse the repository at this point in the history
Change the config command to settings
  • Loading branch information
yjinjo authored Nov 28, 2024
2 parents 6c3dcbf + 97e9a64 commit fff1ffb
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 fff1ffb

Please sign in to comment.