File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ func ExampleApp_Run_commandHelp() {
167
167
Aliases : []string {"d" },
168
168
Usage : "use it to see a description" ,
169
169
Description : "This is how we describe describeit the function" ,
170
+ Args : true ,
170
171
Action : func (c * Context ) error {
171
172
fmt .Printf ("i like to describe things" )
172
173
return nil
@@ -227,7 +228,7 @@ func ExampleApp_Run_subcommandNoAction() {
227
228
// greet describeit - use it to see a description
228
229
//
229
230
// USAGE:
230
- // greet describeit [command options] [arguments...]
231
+ // greet describeit [command options]
231
232
//
232
233
// DESCRIPTION:
233
234
// This is how we describe describeit the function
@@ -1912,6 +1913,7 @@ func TestApp_Run_SubcommandFullPath(t *testing.T) {
1912
1913
subCmd := & Command {
1913
1914
Name : "bar" ,
1914
1915
Usage : "does bar things" ,
1916
+ Args : true ,
1915
1917
}
1916
1918
cmd := & Command {
1917
1919
Name : "foo" ,
@@ -1946,6 +1948,7 @@ func TestApp_Run_SubcommandHelpName(t *testing.T) {
1946
1948
Name : "bar" ,
1947
1949
HelpName : "custom" ,
1948
1950
Usage : "does bar things" ,
1951
+ Args : true ,
1949
1952
}
1950
1953
cmd := & Command {
1951
1954
Name : "foo" ,
@@ -1980,6 +1983,7 @@ func TestApp_Run_CommandHelpName(t *testing.T) {
1980
1983
subCmd := & Command {
1981
1984
Name : "bar" ,
1982
1985
Usage : "does bar things" ,
1986
+ Args : true ,
1983
1987
}
1984
1988
cmd := & Command {
1985
1989
Name : "foo" ,
Original file line number Diff line number Diff line change 1
1
package cli
2
2
3
3
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}}[arguments...] {{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}}`
5
5
var descriptionTemplate = `{{wrap .Description 3}}`
6
6
var authorsTemplate = `{{with $length := len .Authors}}{{if ne 1 $length}}S{{end}}{{end}}:
7
7
{{range $index, $author := .Authors}}{{if $index}}
You can’t perform that action at this time.
0 commit comments