diff --git a/cmd/delete.go b/cmd/delete.go index 5ef00786..fbd3f925 100644 --- a/cmd/delete.go +++ b/cmd/delete.go @@ -21,6 +21,7 @@ Use with caution. This deletes everything and a startup afterwards is like the initial startup of Colima. If you simply want to reset the Kubernetes cluster, run 'colima kubernetes reset'.`, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { if !deleteCmdArgs.force { y := cli.Prompt("are you sure you want to delete " + config.Profile().DisplayName + " and all settings") diff --git a/cmd/kubernetes.go b/cmd/kubernetes.go index 3b17b972..246d0f67 100644 --- a/cmd/kubernetes.go +++ b/cmd/kubernetes.go @@ -34,6 +34,7 @@ var kubernetesStartCmd = &cobra.Command{ Use: "start", Short: "start the Kubernetes cluster", Long: `Start the Kubernetes cluster.`, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { app := newApp() k, err := app.Kubernetes() @@ -54,6 +55,7 @@ var kubernetesStopCmd = &cobra.Command{ Use: "stop", Short: "stop the Kubernetes cluster", Long: `Stop the Kubernetes cluster.`, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { app := newApp() k, err := app.Kubernetes() @@ -73,6 +75,7 @@ var kubernetesDeleteCmd = &cobra.Command{ Use: "delete", Short: "delete the Kubernetes cluster", Long: `Delete the Kubernetes cluster.`, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { app := newApp() k, err := app.Kubernetes() @@ -97,6 +100,7 @@ This resets the Kubernetes cluster and all Kubernetes objects will be deleted. The Kubernetes images are cached making the startup (after reset) much faster.`, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { app := newApp() k, err := app.Kubernetes() diff --git a/cmd/list.go b/cmd/list.go index 4570cdef..a564bfb0 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -19,6 +19,7 @@ var listCmd = &cobra.Command{ Long: `List all created instances. A new instance can be created during 'colima start' by specifying the '--profile' flag.`, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { instances, err := lima.Instances() if err != nil { diff --git a/cmd/nerdctl.go b/cmd/nerdctl.go index b830fcaf..b6f6a53a 100644 --- a/cmd/nerdctl.go +++ b/cmd/nerdctl.go @@ -54,6 +54,7 @@ var nerdctlLinkFunc = func() *cobra.Command { Use: "install", Short: "install nerdctl alias script on the host", Long: `Install nerdctl alias script on the host. The script will be installed at ` + nerdctlDefaultInstallPath + `.`, + Args: cobra.NoArgs, PreRun: func(cmd *cobra.Command, args []string) { // check if /usr/local/bin is writeable and no need for sudo diff --git a/cmd/start.go b/cmd/start.go index 50bc3627..e558c7f6 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -28,6 +28,7 @@ The --runtime, --disk and --arch flags are only used on initial start and ignore " colima start --cpu 4 --memory 8 --disk 100\n" + " colima start --arch aarch64\n" + " colima start --dns 1.1.1.1 --dns 8.8.8.8", + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return newApp().Start(startCmdArgs.Config) }, diff --git a/cmd/status.go b/cmd/status.go index 41e4bbc8..4729146f 100644 --- a/cmd/status.go +++ b/cmd/status.go @@ -10,6 +10,7 @@ var statusCmd = &cobra.Command{ Use: "status", Short: "show the status of Colima", Long: `Show the status of Colima`, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return newApp().Status() }, diff --git a/cmd/stop.go b/cmd/stop.go index 9f0d9f35..b13d1601 100644 --- a/cmd/stop.go +++ b/cmd/stop.go @@ -13,6 +13,7 @@ var stopCmd = &cobra.Command{ The state of the VM is persisted at stop. A start afterwards should return it back to its previous state.`, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return newApp().Stop() }, diff --git a/cmd/version.go b/cmd/version.go index 1fecbbea..118b58d4 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -14,6 +14,7 @@ var versionCmd = &cobra.Command{ Use: "version", Short: "print the version of Colima", Long: `Print the version of Colima`, + Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { version := config.AppVersion() fmt.Println(config.AppName, "version", version.Version)