File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ func (cmd *Command) Subcommand(name string) *Command {
105105
106106// VisibleFlags returns a slice of the Flags, used by `urfave/cli` package to generate help.
107107func (cmd * Command ) VisibleFlags () Flags {
108- return cmd .Flags
108+ return cmd .Flags . VisibleFlags ()
109109}
110110
111111// VisibleSubcommands returns a slice of the Commands with Hidden=false.
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ func (flags Flags) Get(name string) Flag {
4444
4545// Filter returns a list of flags filtered by the given names.
4646func (flags Flags ) Filter (names ... string ) Flags {
47- var filtered Flags
47+ var filtered = make ( Flags , 0 , len ( names ))
4848
4949 for _ , flag := range flags {
5050 for _ , name := range names {
@@ -65,7 +65,7 @@ func (flags Flags) Add(newFlags ...Flag) Flags {
6565// VisibleFlags returns a slice of the Flags.
6666// Used by `urfave/cli` package to generate help.
6767func (flags Flags ) VisibleFlags () Flags {
68- var visibleFlags Flags
68+ var visibleFlags = make ( Flags , 0 , len ( flags ))
6969
7070 for _ , flag := range flags {
7171 if ! flag .GetHidden () {
You can’t perform that action at this time.
0 commit comments