Better error message

Calling `cobra-test echo times one two turkey` where `one` and `two` are
valid arguments but `turkey` is not now results in.

Error: invalid argument "turkey" for "cobra-test echo times"
Run 'cobra-test echo times --help' for usage.
This commit is contained in:
Eric Paris
2015-06-29 17:05:49 -04:00
parent 0a7a850026
commit 9a9d01c9ec
2 changed files with 6 additions and 2 deletions

View File

@ -768,7 +768,7 @@ func TestRootNoCommandHelp(t *testing.T) {
func TestRootUnknownCommand(t *testing.T) {
r := noRRSetupTest("bogus")
s := "Error: unknown command \"bogus\"\nRun 'cobra-test --help' for usage.\n"
s := "Error: unknown command \"bogus\" for \"cobra-test\"\nRun 'cobra-test --help' for usage.\n"
if r.Output != s {
t.Errorf("Unexpected response.\nExpecting to be:\n %q\nGot:\n %q\n", s, r.Output)