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(UsageText): consistent indent for help UsageText output #1279
Conversation
clok
mentioned this pull request
clok
mentioned this pull request
f4d05ec
to
3646146
Compare
Signed-off-by: Derek Smith <dsmith@goodwaygroup.com>
3646146
to
71379de
Compare
|
only thought is might want to also backfill a test that MarkdownDocTemplate does not indent any of the lines (maybe overkill..) |
The markdown is a bit different. The values passed into the template are manipulated before the execution of the template render. Note the As a result, there shouldn't be a need to adjust the template or test for the MD generation. A part of me wants to refactor the MD generation to use template functions more consistently, but that is an out of scope effort that I think warrants more conversation before implementing. |
|
out of scope comment so hope it isn't too distracting. I found indeed markdown could be better handled differently, though to each their own on this. Particularly, there's formatting bias towards help output which doesn't work so well in markdown. I ended up using this which means I don't personally need the markdown feature at the moment: cli.MarkdownDocTemplate = `# GetEnvoy CLI Overview
{{ .App.UsageText }}
# Commands
| Name | Usage |
| ---- | ----- |
{{range $index, $cmd := .App.VisibleCommands}}{{if $index}}
{{end}}| {{$cmd.Name}} | {{$cmd.Usage}} |{{end}}
| --version, -v | Print the version of GetEnvoy |
# Environment Variables
| Name | Usage | Default |
| ---- | ----- | ------- |
{{range $index, $option := .App.VisibleFlags}}{{if $index}}
{{end}}| {{index $option.EnvVars 0}} | {{$option.Usage}} | {{$option.DefaultText}} |{{end}}
` |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

What type of PR is this?
What this PR does / why we need it:
This PR addresses the bug found by @codefromthecrypt and noted in #1278
Which issue(s) this PR fixes:
Fixes #1278
Testing
UsageTextvalues forApp,CommandandSubCommandtypes.Release Notes