Skip to content

Commit

Permalink
Add minimum and maximum verbosity values as constants
Browse files Browse the repository at this point in the history
  • Loading branch information
repson committed May 1, 2024
1 parent f2832c2 commit 9623dfd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hack/ccp/internal/servercmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (

const (
DefaultVerbosity int = 0
MinimumVerbosity int = 0
MaximumVerbosity int = 10
)

func (c *Config) RegisterFlags(fs *flag.FlagSet) {
Expand All @@ -43,7 +45,7 @@ func (c *Config) ConfigureFromEnv() {

func parseVerbosity(v string) int {
value, err := strconv.Atoi(v)
if err == nil || value < 0 || value > 10 {
if err == nil || value < MinimumVerbosity || value > MaximumVerbosity {
return DefaultVerbosity
}

Expand Down

0 comments on commit 9623dfd

Please sign in to comment.