fix(bug) correct response for unknown command or plugin fixes(#309) (#322)

```bash
➜  client git:(issue309) ✗ ./kn lol
Manage your Knative building blocks:
* Serving: Manage your services and release new software to them.
* Eventing: Manage event subscriptions and channels. Connect up event sources.

Usage:
...
Use "kn [command] --help" for more information about a command.

unknown sub-command or plugin "lol" for "kn"
```
This commit is contained in:
dr.max 2019-08-05 01:44:55 -07:00 committed by Knative Prow Robot
parent 759734d473
commit 32470ac256
1 changed files with 3 additions and 1 deletions

View File

@ -76,7 +76,9 @@ func NewDefaultKnCommandWithArgs(rootCmd *cobra.Command,
if _, _, err := rootCmd.Find(cmdPathPieces); err != nil {
err := plugin.HandlePluginCommand(pluginHandler, cmdPathPieces)
if err != nil {
fmt.Fprintf(errOut, "%v\n", err)
rootCmd.Help()
fmt.Println()
fmt.Printf("unknown command or plugin \"%s\" for \"kn\"\n", args[1])
os.Exit(1)
}
}