Skip to content

Commit ba08ebe

Browse files
committed
BoolFlag should respect DefaultText too
1 parent e330487 commit ba08ebe

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ func (tt tabularTemplate) PrepareFlags(flags []cli.Flag) []cliTabularFlagTemplat
420420
Type: flag.TypeName(),
421421
}
422422

423-
if boolFlag, isBool := appFlag.(*cli.BoolFlag); isBool {
424-
f.Default = strconv.FormatBool(boolFlag.Value)
423+
if boolFlag, isBool := appFlag.(*cli.BoolFlag); isBool && defaultText == "" {
424+
f.Default = fmt.Sprintf("`%s`", strconv.FormatBool(boolFlag.Value))
425425
}
426426

427427
for i, name := range appFlag.Names() {

0 commit comments

Comments
 (0)