WIP: Refactor entire project #16
2 changed files with 4 additions and 0 deletions
|
@ -32,6 +32,8 @@ func NewRootCommand(c *config.Config) *cobra.Command {
|
|||
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
||||
if c.Debug {
|
||||
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
||||
} else if c.Quiet {
|
||||
zerolog.SetGlobalLevel(zerolog.ErrorLevel)
|
||||
}
|
||||
|
||||
if c.JSONFormat {
|
||||
|
@ -47,6 +49,7 @@ func NewRootCommand(c *config.Config) *cobra.Command {
|
|||
|
||||
rootCmd.PersistentFlags().BoolVarP(&c.Debug, "debug", "d", false, "Debug output")
|
||||
rootCmd.PersistentFlags().BoolVar(&c.JSONFormat, "json", false, "JSON output")
|
||||
rootCmd.PersistentFlags().BoolVar(&c.Quiet, "quiet", false, "Quiet output (only errors)")
|
||||
rootCmd.PersistentFlags().StringVar(&c.GrafanaURL, "grafana-url", "", "Grafana URL to access the API")
|
||||
rootCmd.PersistentFlags().StringVar(&c.GrafanaToken, "grafana-token", "", "Grafana auth token to access the API")
|
||||
rootCmd.PersistentFlags().StringVar(&c.GitBranch, "git-branch", "main", "Git branch name")
|
||||
|
|
|
@ -19,6 +19,7 @@ type Config struct {
|
|||
GitUser string
|
||||
GitPass string
|
||||
GPGKey string
|
||||
Quiet bool
|
||||
|
||||
Output io.Writer
|
||||
Logger zerolog.Logger
|
||||
|
|
Loading…
Reference in a new issue