mirror of
https://github.com/LukeHagar/sailpoint-cli.git
synced 2025-12-09 20:57:44 +00:00
32 lines
563 B
Go
32 lines
563 B
Go
package set
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
func newDebugCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "debug",
|
|
Short: "enable or disable debug mode",
|
|
Long: "Enable/Disable debug mode.",
|
|
Example: "sail debug enable | disable",
|
|
Args: cobra.ExactArgs(1),
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
switch strings.ToLower(args[0]) {
|
|
case "enable":
|
|
viper.Set("debug", true)
|
|
case "disable":
|
|
viper.Set("debug", false)
|
|
}
|
|
|
|
return nil
|
|
},
|
|
}
|
|
return cmd
|
|
|
|
}
|