Skip to content

Commit

Permalink
don't force caller to have ArgsHelp lead with a space
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly committed Feb 19, 2023
1 parent ecb8a88 commit b3ad9dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ func Main() bool {
Config.ArgsHelp += fmt.Sprintf(" [arg%d...arg%d]", Config.MinArgs+1, Config.MaxArgs)
}
}
// Callers can pass that part of the help with or without leading space
if !strings.HasPrefix(Config.ArgsHelp, " ") {
Config.ArgsHelp = " " + Config.ArgsHelp
}
if !ServerMode {
log.SetDefaultsForClientTools()
log.LoggerStaticFlagSetup("loglevel")
Expand Down

0 comments on commit b3ad9dc

Please sign in to comment.