Skip to content

Commit

Permalink
fix_hidden_params_bc_for_gateway (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuvia-akeyless authored Nov 24, 2024
1 parent 8171930 commit 4807bfe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ func initFlagSet(typ reflect.Type, val reflect.Value, flagSet *flagSet, clr colo
if fl == nil {
continue
}
// hidden flag shouldn't appear in usage menu (--help)
if dontSetValue && fl.tag.hidden {
// hidden flag shouldn't appear in usage menu (--help).
// if env SHOW_HIDDEN_CLI_COMMANDS is set, hidden flags will be shown.
if dontSetValue && fl.tag.hidden && !revealHiddenParams() {
continue
}
flagSet.flagSlice = append(flagSet.flagSlice, fl)
Expand Down Expand Up @@ -377,3 +378,8 @@ func parseSiameseFlag(flagSet *flagSet, firstHalf, latterHalf string, clr color.
}
return nil, false
}

func revealHiddenParams() bool {
_, forceReveal := os.LookupEnv("SHOW_HIDDEN_CLI_COMMANDS")
return forceReveal
}

0 comments on commit 4807bfe

Please sign in to comment.