cobra icon indicating copy to clipboard operation
cobra copied to clipboard

Do not generate docs for hidden flags

Open kevinbarbour opened this issue 2 years ago • 5 comments

fixes #1663

kevinbarbour avatar Apr 12 '22 10:04 kevinbarbour

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 12 '22 10:04 CLAassistant

@jpmcb The other doc generators already work this way.

man page generation skips hidden flags: https://github.com/spf13/cobra/blob/9e88759b19cd358e9af6f0d778b9a23990cf7f51/doc/man_docs.go#L160

markdown and rest docs use flags.PrintDefaults() in pflag which skips hidden flags.

kevinbarbour avatar May 10 '22 11:05 kevinbarbour

The Cobra project currently lacks enough contributors to adequately respond to all PRs. This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied. - After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied and the PR is closed. You can:
  • Make a comment to remove the stale label and show your support. The 60 days reset. - If a PR has lifecycle/rotten and is closed, comment and ask maintainers if they'd be interseted in reopening.

github-actions[bot] avatar Sep 08 '22 00:09 github-actions[bot]

@jpmcb Any plans to merge this one or should I go ahead and close it out?

kevinbarbour avatar Mar 29 '23 14:03 kevinbarbour

We could really use this bugfix. @kevinbarbour any chance you can fix it up? If not, I'm happy to open a new PR.

smottt avatar Nov 17 '23 08:11 smottt