-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(docs): generate cli docs directly from the struct #12717
base: master
Are you sure you want to change the base?
feat(docs): generate cli docs directly from the struct #12717
Conversation
Looks like a lot of the logic for this lives in https://github.com/urfave/cli/blob/main/help.go and the templates in here (unfortunately not exported!) are here: https://github.com/urfave/cli/blob/main/template.go Use this as an exercise in minimising the diff, that's your challenge - how can you get to near zero red/green lines in the diff here for the documentation output, aiming to only make changes where the existing script is getting it wrong (mostly missing some things I believe). |
1f2c2c4
to
f616568
Compare
@akaladarshi : I assume you'll re-request review when you're ready for it to be looked at again. |
Very close @akaladarshi, good work so far. I haven't done an in-depth review of the actual code, I'm mainly looking at the output and assuming that the code is good, I'll look over that next. |
@rvagg I think I found a minimum solution for this we can directly use the urface cli package for generating, Initially I though we need to print everything (hidden), but this will directly print the correct format value. customAppData := func() map[string]interface{} {
return map[string]interface{}{
"ExtraInfo": g.app.ExtraInfo,
}
}
cli.HelpPrinterCustom(header, cli.AppHelpTemplate, g.app, customAppData()) |
Removed the above change in favour of |
b9a161b
to
7fe23b0
Compare
Squashed down to a single commit and rebased onto current master in this branch. |
Related Issues
Fixes: #12706