Display an error when help is called on a non existing command.
This commit is contained in:
parent
68ecf78f0e
commit
a34876d700
2 changed files with 21 additions and 5 deletions
|
@ -103,6 +103,22 @@ func Test_execute(t *testing.T) {
|
|||
},
|
||||
expected: expected{error: true},
|
||||
},
|
||||
{
|
||||
desc: "root command, call help, with argument, command not found",
|
||||
args: []string{"", "echo", "--help"},
|
||||
command: func() *Command {
|
||||
return &Command{
|
||||
Name: "root",
|
||||
Description: "This is a test",
|
||||
Configuration: nil,
|
||||
Run: func(_ []string) error {
|
||||
called = "root"
|
||||
return nil
|
||||
},
|
||||
}
|
||||
},
|
||||
expected: expected{error: true},
|
||||
},
|
||||
{
|
||||
desc: "one sub command",
|
||||
args: []string{"", "sub1"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue