Skip to content

Commit

Permalink
[OTEL-2309] Fix panic in /otel-agent -h
Browse files Browse the repository at this point in the history
  • Loading branch information
songy23 committed Jan 6, 2025
1 parent 5001b19 commit a35aac3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/otel-agent/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ func makeCommands(globalParams *subcommands.GlobalParams) *cobra.Command {
true, // show env variable value in usage
)

if err := ef.Parse(os.Args[1:]); err != nil {
// There may be other env vars in addition to the ones in envflag.NewEnvFlag. Do not panic if those env vars do not have a help message (flag.ErrHelp)
if err := ef.Parse(os.Args[1:]); err != nil && err != flag.ErrHelp {
panic(err)
}

Expand Down

0 comments on commit a35aac3

Please sign in to comment.