Skip to content

Commit 20137fe

Browse files
committed
Apply @makkes suggestion
Signed-off-by: Vinícius Garcia <vingarcia00@gmail.com>
1 parent 025a4ed commit 20137fe

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

cmd/flux/install.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"fmt"
2222
"os"
2323
"path/filepath"
24-
"strings"
2524
"time"
2625

2726
"github.com/manifoldco/promptui"
@@ -37,6 +36,7 @@ import (
3736

3837
var installCmd = &cobra.Command{
3938
Use: "install",
39+
Args: cobra.NoArgs,
4040
Short: "Install or upgrade Flux",
4141
Long: `The install command deploys Flux in the specified namespace.
4242
If a previous version is installed, then an in-place upgrade will be performed.`,
@@ -115,10 +115,6 @@ func NewInstallFlags() installFlags {
115115
}
116116

117117
func installCmdRun(cmd *cobra.Command, args []string) error {
118-
if len(args) > 0 {
119-
return fmt.Errorf(`flux install received unexpected positional arguments: "%s"`, strings.Join(args, `", "`))
120-
}
121-
122118
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
123119
defer cancel()
124120

cmd/flux/install_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ func TestInstall(t *testing.T) {
3939
},
4040
{
4141
name: "invalid namespace",
42-
args: "install unexpected pos arg --namespace=example",
43-
assert: assertError("flux install received unexpected positional arguments: \"unexpected\", \"pos\", \"arg\""),
42+
args: "install unexpectedPosArg --namespace=example",
43+
assert: assertError(`unknown command "unexpectedPosArg" for "flux install"`),
4444
},
4545
}
4646

0 commit comments

Comments
 (0)