Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the config command to settings #58

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading