diff --git a/cmd/flux/install.go b/cmd/flux/install.go index 795cc1aa..bf0ee758 100644 --- a/cmd/flux/install.go +++ b/cmd/flux/install.go @@ -36,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.`, diff --git a/cmd/flux/install_test.go b/cmd/flux/install_test.go index f10f7d62..5cb0fa66 100644 --- a/cmd/flux/install_test.go +++ b/cmd/flux/install_test.go @@ -37,6 +37,11 @@ func TestInstall(t *testing.T) { args: "install --namespace='@#[]'", assert: assertError("namespace must be a valid DNS label: \"@#[]\""), }, + { + name: "invalid sub-command", + args: "install unexpectedPosArg --namespace=example", + assert: assertError(`unknown command "unexpectedPosArg" for "flux install"`), + }, } for _, tt := range tests {