Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct command path in see_also for YAML doc #1771

Merged
merged 1 commit into from
Aug 13, 2022

Conversation

zregvart
Copy link
Contributor

@zregvart zregvart commented Aug 4, 2022

The see_also section for child commands would include only the name of command. This adds the whole path, similar to how it's done for the other documentation formats.

The `see_also` section for child commands would include only the name of
command. This adds the whole path, similar to how it's done for the
other documentation formats.
@CLAassistant
Copy link

CLAassistant commented Aug 4, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added area/docs-generation Generation of docs via Cobra size/XS Denotes a PR that changes 0-9 lines labels Aug 4, 2022
Copy link

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable.

Copy link
Collaborator

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's much better, thanks @zregvart! (and thanks @stmcginnis for having a look)
I have tested it with helm and if we take the helm repo command and generate the yaml tree, the generated yaml before this PR would end with:

see_also:
- helm - The Helm package manager for Kubernetes.
- add - add a chart repository
- index - generate an index file given a directory containing packaged charts
- list - list chart repositories
- remove - remove one or more chart repositories
- update - update information of available charts locally from chart repositories

but now:

see_also:
- helm - The Helm package manager for Kubernetes.
- helm repo add - add a chart repository
- helm repo index - generate an index file given a directory containing packaged charts
- helm repo list - list chart repositories
- helm repo remove - remove one or more chart repositories
- helm repo update - update information of available charts locally from chart repositories

It is not only much clearer but it does match what we output for markdown and man docs.

@marckhouzam marckhouzam merged commit 7790bf9 into spf13:main Aug 13, 2022
@marckhouzam marckhouzam added this to the 1.6.0 milestone Aug 13, 2022
@zregvart zregvart deleted the pr/yaml-command-path-in-see-also branch August 15, 2022 08:49
@zregvart
Copy link
Contributor Author

Thanks @stmcginnis and @marckhouzam!

jimschubert added a commit to jimschubert/cobra that referenced this pull request Oct 3, 2022
* main: (39 commits)
  Add '--version' flag to Help output (spf13#1707)
  Expose ValidateRequiredFlags and ValidateFlagGroups (spf13#1760)
  Document option to hide the default completion cmd (spf13#1779)
  ci: add workflow_dispatch (spf13#1387)
  add missing license headers (spf13#1809)
  ci: use action/setup-go's cache (spf13#1783)
  Adjustments to documentation (spf13#1656)
  Rename Powershell completion tests (spf13#1803)
  Support for case-insensitive command names (spf13#1802)
  Deprecate ExactValidArgs() and test combinations of args validators (spf13#1643)
  Use correct stale action `exempt-` yaml keys (spf13#1800)
  With go 1.18, we must use go install for a binary (spf13#1726)
  Clarify SetContext documentation (spf13#1748)
  ci: test on Golang 1.19 (spf13#1782)
  fix: show flags that shadow parent persistent flag in child help (spf13#1776)
  Update gopkg.in/yaml.v2 to gopkg.in/yaml.v3 (spf13#1766)
  fix(bash-v2): activeHelp length check syntax (spf13#1762)
  fix: correct command path in see_also for YAML doc (spf13#1771)
  build(deps): bump github.com/inconshreveable/mousetrap (spf13#1774)
  docs: add zitadel to the list (spf13#1772)
  ...
hoshsadiq pushed a commit to zulucmd/zulu that referenced this pull request Dec 31, 2022
The `see_also` section for child commands would include only the name of
command. This adds the whole path, similar to how it's done for the
other documentation formats.

Merge spf13/cobra#1771
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs-generation Generation of docs via Cobra size/XS Denotes a PR that changes 0-9 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants