Skip to content

Commit

Permalink
Merge pull request #999 from subpop/master
Browse files Browse the repository at this point in the history
Use VisibleFlags during doc generation
  • Loading branch information
coilysiren authored Dec 20, 2019
2 parents 716b748 + 8827318 commit 841e5b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func (a *App) writeDocTemplate(w io.Writer) error {
return t.ExecuteTemplate(w, name, &cliTemplate{
App: a,
Commands: prepareCommands(a.Commands, 0),
GlobalArgs: prepareArgsWithValues(a.Flags),
SynopsisArgs: prepareArgsSynopsis(a.Flags),
GlobalArgs: prepareArgsWithValues(a.VisibleFlags()),
SynopsisArgs: prepareArgsSynopsis(a.VisibleFlags()),
})
}

Expand Down
4 changes: 4 additions & 0 deletions docs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func testApp() *App {
Aliases: []string{"b"},
Usage: "another usage text",
},
&BoolFlag{
Name: "hidden-flag",
Hidden: true,
},
}
app.Commands = []*Command{{
Aliases: []string{"c"},
Expand Down

0 comments on commit 841e5b0

Please sign in to comment.