From 90be2dcf9ff08351554bd049760c4dcd4ea9aacf Mon Sep 17 00:00:00 2001 From: Alena Varkockova Date: Fri, 15 Nov 2019 13:38:19 +0100 Subject: [PATCH] Better output when incorrect args in uninstall --- pkg/kudoctl/cmd/uninstall.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/kudoctl/cmd/uninstall.go b/pkg/kudoctl/cmd/uninstall.go index 1d986515c..23c658a7b 100644 --- a/pkg/kudoctl/cmd/uninstall.go +++ b/pkg/kudoctl/cmd/uninstall.go @@ -59,7 +59,12 @@ func newUninstallCmd() *cobra.Command { Short: "Uninstall a KUDO package.", Long: "Uninstall the instance of a KUDO package. This also removes dependent objects, e.g. deployments, pods", Example: uninstallExample, - Args: cobra.NoArgs, + Args: func(cmd *cobra.Command, args []string) error { + if len(args) != 0 { + return fmt.Errorf("The command expects no arguments and --instance flag must be provided.\n %s", cmd.UsageString()) + } + return nil + }, RunE: func(cmd *cobra.Command, args []string) error { return uninstall.run(options, &Settings) },