Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

prevent logger flag from overriding --help #1217

Merged
merged 2 commits into from
Oct 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ func Seed(ctx context.Context) (ctxOut context.Context, zsl *zap.SugaredLogger)
fs := pflag.NewFlagSet("seed-logger", pflag.ContinueOnError)
fs.ParseErrorsWhitelist.UnknownFlags = true
fs.String("log-level", "info", "set the log level to debug|info|warn|error")
// prevents overriding the corso/cobra help processor
fs.BoolP("help", "h", false, "")

// parse the os args list to find the log level flag
if err := fs.Parse(os.Args[1:]); err != nil {
Expand Down