Skip to content

Commit 5bf273f

Browse files
authored
Merge pull request #105 from hookdeck/chore/remove-global-key-flags
chore: hide api-key and cli-key global flags
2 parents 0c53cbd + 40c7111 commit 5bf273f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/cmd/root.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,33 @@ func init() {
8888
cobra.OnInitialize(Config.InitConfig)
8989

9090
rootCmd.PersistentFlags().StringVarP(&Config.Profile.Name, "profile", "p", "", fmt.Sprintf("profile name (default \"%s\")", hookdeck.DefaultProfileName))
91+
9192
rootCmd.PersistentFlags().StringVar(&Config.Profile.APIKey, "cli-key", "", "(deprecated) Your API key to use for the command")
93+
rootCmd.PersistentFlags().MarkHidden("cli-key")
94+
9295
rootCmd.PersistentFlags().StringVar(&Config.Profile.APIKey, "api-key", "", "Your API key to use for the command")
96+
rootCmd.PersistentFlags().MarkHidden("api-key")
97+
9398
rootCmd.PersistentFlags().StringVar(&Config.Color, "color", "", "turn on/off color output (on, off, auto)")
99+
94100
rootCmd.PersistentFlags().StringVar(&Config.LocalConfigFile, "config", "", "config file (default is $HOME/.config/hookdeck/config.toml)")
101+
95102
rootCmd.PersistentFlags().StringVar(&Config.DeviceName, "device-name", "", "device name")
103+
96104
rootCmd.PersistentFlags().StringVar(&Config.LogLevel, "log-level", "info", "log level (debug, info, warn, error)")
105+
97106
rootCmd.PersistentFlags().BoolVar(&Config.Insecure, "insecure", false, "Allow invalid TLS certificates")
98107

99108
// Hidden configuration flags, useful for dev/debugging
100109
rootCmd.PersistentFlags().StringVar(&Config.APIBaseURL, "api-base", "", fmt.Sprintf("Sets the API base URL (default \"%s\")", hookdeck.DefaultAPIBaseURL))
101110
rootCmd.PersistentFlags().MarkHidden("api-base")
111+
102112
rootCmd.PersistentFlags().StringVar(&Config.DashboardBaseURL, "dashboard-base", "", fmt.Sprintf("Sets the web dashboard base URL (default \"%s\")", hookdeck.DefaultDashboardBaseURL))
103113
rootCmd.PersistentFlags().MarkHidden("dashboard-base")
114+
104115
rootCmd.PersistentFlags().StringVar(&Config.ConsoleBaseURL, "console-base", "", fmt.Sprintf("Sets the web console base URL (default \"%s\")", hookdeck.DefaultConsoleBaseURL))
105116
rootCmd.PersistentFlags().MarkHidden("console-base")
117+
106118
rootCmd.PersistentFlags().StringVar(&Config.WSBaseURL, "ws-base", "", fmt.Sprintf("Sets the Websocket base URL (default \"%s\")", hookdeck.DefaultWebsocektURL))
107119
rootCmd.PersistentFlags().MarkHidden("ws-base")
108120

0 commit comments

Comments
 (0)