Skip to content

Commit fa2b127

Browse files
committed
fix tests
1 parent 427677a commit fa2b127

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ func ExampleApp_Run_commandHelp() {
167167
Aliases: []string{"d"},
168168
Usage: "use it to see a description",
169169
Description: "This is how we describe describeit the function",
170+
Args: true,
170171
Action: func(c *Context) error {
171172
fmt.Printf("i like to describe things")
172173
return nil
@@ -227,7 +228,7 @@ func ExampleApp_Run_subcommandNoAction() {
227228
// greet describeit - use it to see a description
228229
//
229230
// USAGE:
230-
// greet describeit [command options] [arguments...]
231+
// greet describeit [command options]
231232
//
232233
// DESCRIPTION:
233234
// This is how we describe describeit the function
@@ -1912,6 +1913,7 @@ func TestApp_Run_SubcommandFullPath(t *testing.T) {
19121913
subCmd := &Command{
19131914
Name: "bar",
19141915
Usage: "does bar things",
1916+
Args: true,
19151917
}
19161918
cmd := &Command{
19171919
Name: "foo",
@@ -1946,6 +1948,7 @@ func TestApp_Run_SubcommandHelpName(t *testing.T) {
19461948
Name: "bar",
19471949
HelpName: "custom",
19481950
Usage: "does bar things",
1951+
Args: true,
19491952
}
19501953
cmd := &Command{
19511954
Name: "foo",
@@ -1980,6 +1983,7 @@ func TestApp_Run_CommandHelpName(t *testing.T) {
19801983
subCmd := &Command{
19811984
Name: "bar",
19821985
Usage: "does bar things",
1986+
Args: true,
19831987
}
19841988
cmd := &Command{
19851989
Name: "foo",

template.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package cli
22

33
var helpNameTemplate = `{{$v := offset .HelpName 6}}{{wrap .HelpName 3}}{{if .Usage}} - {{wrap .Usage $v}}{{end}}`
4-
var usageTemplate = `{{if .UsageText}}{{wrap .UsageText 3}}{{else}}{{.HelpName}}{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}{{if .Args}}[arguments...]{{end}}{{end}}{{end}}`
4+
var usageTemplate = `{{if .UsageText}}{{wrap .UsageText 3}}{{else}}{{.HelpName}}{{if .VisibleFlags}} [command options]{{end}}{{if .ArgsUsage}}{{.ArgsUsage}}{{else}}{{if .Args}} [arguments...]{{end}}{{end}}{{end}}`
55
var descriptionTemplate = `{{wrap .Description 3}}`
66
var authorsTemplate = `{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}:
77
{{range $index, $author := .Authors}}{{if $index}}

0 commit comments

Comments
 (0)