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

Examine that docs/command-reference.md has all the flags #3647

Open
1 task
AkihiroSuda opened this issue Nov 6, 2024 · 6 comments
Open
1 task

Examine that docs/command-reference.md has all the flags #3647

AkihiroSuda opened this issue Nov 6, 2024 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@AkihiroSuda
Copy link
Member

https://github.com/containerd/nerdctl/blob/main/docs/command-reference.md

Missing:

  • nerdctl run --log-driver=none
    ...

Ideally this document should be auto-generated

@AkihiroSuda AkihiroSuda added documentation Improvements or additions to documentation good first issue Good for newcomers labels Nov 6, 2024
@PranshuSrivastava
Copy link

/assign

@PranshuSrivastava
Copy link

@AkihiroSuda when exactly should this be autogenerated? on a new release? or when a new command is merged to main?

@AkihiroSuda
Copy link
Member Author

@AkihiroSuda when exactly should this be autogenerated? on a new release? or when a new command is merged to main?

Probably latter

@PranshuSrivastava
Copy link

Well I can think of only two ways in which we can enforce this, first is, to somehow add this as a test in the github pipeline so that whenever there is a new pr for a command, the author is prompted to also update the docs for it, or we take the code and feed into some ai model that can generate the documentation accordingly. But the second option could lead to many mistakes and also would be a pretty cumbersome process.
What do you think?

@AkihiroSuda
Copy link
Member Author

AkihiroSuda commented Nov 12, 2024

https://pkg.go.dev/github.com/spf13/pflag#FlagSet.SetAnnotation should be used to annotate flag descriptions.

These descriptions should not be shown in --help as they would be too verbose.
Something like make docs should consume those annotations to generate docs/command-reference.md.
CI should fail when the file is out of sync.

@PranshuSrivastava
Copy link

annotating flag descriptions with this library is not a good idea because these annotations do not show up when the help command is called. So we will need to have both descriptions and annotations for a flag, or I can just compile the descriptions using the make command and generate the md file with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants