-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 improper whitespace formatting in usageTemplate variable #1946
Conversation
Hi, thanks for the contribution! Could you show a comparison of before/after? |
// test.go
package main
import (
"os"
cli "github.com/urfave/cli/v2"
)
func main() {
app := cli.NewApp()
app.ArgsUsage = "[arg1]"
app.Commands = []*cli.Command{
{
Name: "cmd1",
ArgsUsage: "[arg2]",
Action: func(cctx *cli.Context) error {
return nil
},
},
}
err := app.Run(os.Args)
if err != nil {
panic(err)
}
}
but
differencethere is no space between comand options and custom args usage.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SubcommandHelpTemplate
seems to have the same whitespace problem too. Would you mind taking a look as well?
Lines 82 to 86 in 84c536d
var SubcommandHelpTemplate = `NAME: | |
{{template "helpNameTemplate" .}} | |
USAGE: | |
{{if .UsageText}}{{wrap .UsageText 3}}{{else}}{{.HelpName}} {{if .VisibleFlags}}command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}{{if .Args}}[arguments...]{{end}}{{end}}{{end}}{{if .Description}} |
I'm sorry that when modifying the code today, I missed some variables related to ArgsUsage for the sake of convenience in using the vim editor. The whitespace issue in the SubcommandHelpTemplate variable has now been fixed, and running 'go test ./...' shows no problems. |
@caeret Sorry looks like I messed up the commit by force pushing v2-maint to your repo. . Can you repush your PR ? Also run "make docs" and "make v2approve" |
Closed by mistake |
just fix usageTemplate variable in
template.go