From e3f575397cb1f2435fd476dd15e4ba475a44b2a2 Mon Sep 17 00:00:00 2001 From: "dr.max" Date: Wed, 31 Jul 2019 14:23:35 -0700 Subject: [PATCH] fix(bug) correct response for unknown command or plugin fixes(#309) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ```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" ``` --- pkg/kn/core/root.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/kn/core/root.go b/pkg/kn/core/root.go index 2f5485fe7f..3a3ed47870 100644 --- a/pkg/kn/core/root.go +++ b/pkg/kn/core/root.go @@ -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) } }