Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consistent usage hint for unknown subcommand and flag
Now, when you try to run a Command with an unknown sub-command vs. an unknown flag, you'll get: ``` $ testcommand asdsa Error: unknown command "asdsa" for "testcommand" Run 'testcommand --help' for usage. $ testcommand --asdsa Error: unknown flag: --asdsa $ testcommand -asdsa Error: unknown shorthand flag: 'a' in -asdsa ``` With these changes, you'll get: ``` $ testcommand asdsa Error: unknown command "asdsa" for "testcommand" Run 'testcommand --help' for usage. $ testcommand --asdsa Error: unknown flag: --asdsa Run 'testcommand --help' for usage. $ testcommand -asdsa Error: unknown shorthand flag: 'a' in -asdsa Run 'testcommand --help' for usage. ``` Merge spf13/cobra#1023
- Loading branch information