diff --git a/cmd/flux/install.go b/cmd/flux/install.go index df1f3a2e58..bf0ee758de 100644 --- a/cmd/flux/install.go +++ b/cmd/flux/install.go @@ -21,7 +21,6 @@ import ( "fmt" "os" "path/filepath" - "strings" "time" "github.com/manifoldco/promptui" @@ -37,6 +36,7 @@ import ( var installCmd = &cobra.Command{ Use: "install", + Args: cobra.NoArgs, Short: "Install or upgrade Flux", Long: `The install command deploys Flux in the specified namespace. If a previous version is installed, then an in-place upgrade will be performed.`, @@ -115,10 +115,6 @@ func NewInstallFlags() installFlags { } func installCmdRun(cmd *cobra.Command, args []string) error { - if len(args) > 0 { - return fmt.Errorf(`flux install received unexpected positional arguments: "%s"`, strings.Join(args, `", "`)) - } - ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout) defer cancel() diff --git a/cmd/flux/install_test.go b/cmd/flux/install_test.go index 6c00490727..357f3afd0f 100644 --- a/cmd/flux/install_test.go +++ b/cmd/flux/install_test.go @@ -39,8 +39,8 @@ func TestInstall(t *testing.T) { }, { name: "invalid namespace", - args: "install unexpected pos arg --namespace=example", - assert: assertError("flux install received unexpected positional arguments: \"unexpected\", \"pos\", \"arg\""), + args: "install unexpectedPosArg --namespace=example", + assert: assertError(`unknown command "unexpectedPosArg" for "flux install"`), }, }