refactor: remove --debug flag, keep --verbose/-v only
This commit is contained in:
+4
-5
@@ -26,7 +26,7 @@ var (
|
|||||||
flagProvider string
|
flagProvider string
|
||||||
flagOutput string
|
flagOutput string
|
||||||
flagRaw bool
|
flagRaw bool
|
||||||
flagDebug bool
|
flagVerbose bool
|
||||||
)
|
)
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
@@ -67,7 +67,7 @@ Use "ry [command] --help" for more information about a command.`,
|
|||||||
AccessKeyID: pc.AccessKeyID,
|
AccessKeyID: pc.AccessKeyID,
|
||||||
AccessKeySecret: pc.AccessKeySecret,
|
AccessKeySecret: pc.AccessKeySecret,
|
||||||
Endpoint: pc.Endpoint,
|
Endpoint: pc.Endpoint,
|
||||||
Debug: flagDebug,
|
Debug: flagVerbose,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -81,7 +81,7 @@ Use "ry [command] --help" for more information about a command.`,
|
|||||||
outputFormat = "raw"
|
outputFormat = "raw"
|
||||||
}
|
}
|
||||||
out = output.New(outputFormat, os.Stdout)
|
out = output.New(outputFormat, os.Stdout)
|
||||||
if flagDebug {
|
if flagVerbose {
|
||||||
fmt.Fprintf(os.Stderr, "[debug] provider: %s\n", providerName)
|
fmt.Fprintf(os.Stderr, "[debug] provider: %s\n", providerName)
|
||||||
fmt.Fprintf(os.Stderr, "[debug] config: %s\n", cfgPath)
|
fmt.Fprintf(os.Stderr, "[debug] config: %s\n", cfgPath)
|
||||||
fmt.Fprintf(os.Stderr, "[debug] output: %s\n", outputFormat)
|
fmt.Fprintf(os.Stderr, "[debug] output: %s\n", outputFormat)
|
||||||
@@ -95,8 +95,7 @@ func init() {
|
|||||||
rootCmd.PersistentFlags().StringVarP(&flagProvider, "provider", "p", "", "Cloud provider to use")
|
rootCmd.PersistentFlags().StringVarP(&flagProvider, "provider", "p", "", "Cloud provider to use")
|
||||||
rootCmd.PersistentFlags().StringVarP(&flagOutput, "output", "o", "", "Output format: table, json, yaml, raw")
|
rootCmd.PersistentFlags().StringVarP(&flagOutput, "output", "o", "", "Output format: table, json, yaml, raw")
|
||||||
rootCmd.PersistentFlags().BoolVar(&flagRaw, "raw", false, "Output raw API response")
|
rootCmd.PersistentFlags().BoolVar(&flagRaw, "raw", false, "Output raw API response")
|
||||||
rootCmd.PersistentFlags().BoolVarP(&flagDebug, "verbose", "v", false, "Enable verbose/debug output")
|
rootCmd.PersistentFlags().BoolVarP(&flagVerbose, "verbose", "v", false, "Enable verbose output")
|
||||||
rootCmd.PersistentFlags().BoolVar(&flagDebug, "debug", false, "Enable debug output")
|
|
||||||
|
|
||||||
completionCmd := &cobra.Command{
|
completionCmd := &cobra.Command{
|
||||||
Use: "completion [bash|zsh|fish]",
|
Use: "completion [bash|zsh|fish]",
|
||||||
|
|||||||
Reference in New Issue
Block a user