diff --git a/cmd/benchmark.go b/cmd/benchmark.go index b51d6e14ea..101fc4e084 100644 --- a/cmd/benchmark.go +++ b/cmd/benchmark.go @@ -80,6 +80,7 @@ func getPipelineCommand() *cobra.Command { Use: "pipeline", Short: "Run pipeline benchmarks", Long: "Run pipeline benchmarks for the package", + Args: cobra.NoArgs, RunE: pipelineCommandAction, } @@ -212,6 +213,7 @@ func getSystemCommand() *cobra.Command { Use: "system", Short: "Run system benchmarks", Long: "Run system benchmarks for the package", + Args: cobra.NoArgs, RunE: systemCommandAction, } @@ -338,6 +340,7 @@ func getGenerateCorpusCommand() *cobra.Command { Use: "generate-corpus", Short: "Generate benchmarks corpus data for the package", Long: generateLongDescription, + Args: cobra.NoArgs, RunE: generateDataStreamCorpusCommandAction, } diff --git a/cmd/build.go b/cmd/build.go index 2a38e355e1..00d86d329f 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -34,6 +34,7 @@ func setupBuildCommand() *cobraext.Command { Use: "build", Short: "Build the package", Long: buildLongDescription, + Args: cobra.NoArgs, RunE: buildCommandAction, } cmd.Flags().Bool(cobraext.BuildZipFlagName, true, cobraext.BuildZipFlagDescription) diff --git a/cmd/changelog.go b/cmd/changelog.go index 523a5597ff..bfdf5599b6 100644 --- a/cmd/changelog.go +++ b/cmd/changelog.go @@ -37,6 +37,7 @@ func setupChangelogCommand() *cobraext.Command { Use: "add", Short: "Add an entry to the changelog file", Long: changelogAddLongDescription, + Args: cobra.NoArgs, RunE: changelogAddCmd, } addChangelogCmd.Flags().String(cobraext.ChangelogAddNextFlagName, "", cobraext.ChangelogAddNextFlagDescription) diff --git a/cmd/check.go b/cmd/check.go index 22e86deb19..d28892800d 100644 --- a/cmd/check.go +++ b/cmd/check.go @@ -21,6 +21,7 @@ func setupCheckCommand() *cobraext.Command { Use: "check", Short: "Check the package", Long: checkLongDescription, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { err := cobraext.ComposeCommands(args, setupFormatCommand(), diff --git a/cmd/clean.go b/cmd/clean.go index 48794116e9..f6dfade96e 100644 --- a/cmd/clean.go +++ b/cmd/clean.go @@ -22,6 +22,7 @@ func setupCleanCommand() *cobraext.Command { Use: "clean", Short: "Clean used resources", Long: cleanLongDescription, + Args: cobra.NoArgs, RunE: cleanCommandAction, } diff --git a/cmd/create.go b/cmd/create.go index 1a20dc1adb..300a291750 100644 --- a/cmd/create.go +++ b/cmd/create.go @@ -21,6 +21,7 @@ func setupCreateCommand() *cobraext.Command { Use: "package", Short: "Create new package", Long: createPackageLongDescription, + Args: cobra.NoArgs, RunE: createPackageCommandAction, } @@ -28,6 +29,7 @@ func setupCreateCommand() *cobraext.Command { Use: "data-stream", Short: "Create new data stream", Long: createDataStreamLongDescription, + Args: cobra.NoArgs, RunE: createDataStreamCommandAction, } diff --git a/cmd/dump.go b/cmd/dump.go index 40ef778767..fe75cc1fa7 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -35,6 +35,7 @@ func setupDumpCommand() *cobraext.Command { Use: "installed-objects", Short: "Dump objects installed in the stack", Long: dumpInstalledObjectsLongDescription, + Args: cobra.NoArgs, RunE: dumpInstalledObjectsCmdAction, } dumpInstalledObjectsCmd.Flags().Bool(cobraext.TLSSkipVerifyFlagName, false, cobraext.TLSSkipVerifyFlagDescription) @@ -45,6 +46,7 @@ func setupDumpCommand() *cobraext.Command { Use: "agent-policies", Short: "Dump agent policies defined in the stack", Long: dumpAgentPoliciesLongDescription, + Args: cobra.NoArgs, RunE: dumpAgentPoliciesCmdAction, } dumpAgentPoliciesCmd.Flags().StringP(cobraext.AgentPolicyFlagName, "", "", cobraext.AgentPolicyDescription) diff --git a/cmd/export.go b/cmd/export.go index 19ee8d009d..ba605e96dd 100644 --- a/cmd/export.go +++ b/cmd/export.go @@ -29,6 +29,7 @@ func setupExportCommand() *cobraext.Command { Use: "dashboards", Short: "Export dashboards from Kibana", Long: exportDashboardsLongDescription, + Args: cobra.NoArgs, RunE: exportDashboardsCmd, } exportDashboardCmd.Flags().StringSliceP(cobraext.DashboardIDsFlagName, "d", nil, cobraext.DashboardIDsFlagDescription) diff --git a/cmd/format.go b/cmd/format.go index 622a76cf7e..8a654f790f 100644 --- a/cmd/format.go +++ b/cmd/format.go @@ -24,6 +24,7 @@ func setupFormatCommand() *cobraext.Command { Use: "format", Short: "Format the package", Long: formatLongDescription, + Args: cobra.NoArgs, RunE: formatCommandAction, } cmd.Flags().BoolP(cobraext.FailFastFlagName, "f", false, cobraext.FailFastFlagDescription) diff --git a/cmd/install.go b/cmd/install.go index d826270d99..7a19c06ac0 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -25,6 +25,7 @@ func setupInstallCommand() *cobraext.Command { Use: "install", Short: "Install the package", Long: installLongDescription, + Args: cobra.NoArgs, RunE: installCommandAction, } cmd.Flags().StringSliceP(cobraext.CheckConditionFlagName, "c", nil, cobraext.CheckConditionFlagDescription) diff --git a/cmd/lint.go b/cmd/lint.go index daf0a0be38..81344609d5 100644 --- a/cmd/lint.go +++ b/cmd/lint.go @@ -26,6 +26,7 @@ func setupLintCommand() *cobraext.Command { Use: "lint", Short: "Lint the package", Long: lintLongDescription, + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { err := cobraext.ComposeCommandActions(cmd, args, lintCommandAction, diff --git a/cmd/report.go b/cmd/report.go index 6a4f0f1d59..fed90f09c3 100644 --- a/cmd/report.go +++ b/cmd/report.go @@ -65,6 +65,7 @@ func getBenchReportCommand() *cobra.Command { Use: "benchmark", Short: "Generate a benchmark report", Long: "Generate a benchmark report comparing local results against ones from another benchmark run.", + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { cmd.Printf("Generate benchmark reports\n") diff --git a/cmd/service.go b/cmd/service.go index c095385c01..113c8528d2 100644 --- a/cmd/service.go +++ b/cmd/service.go @@ -26,6 +26,7 @@ func setupServiceCommand() *cobraext.Command { upCommand := &cobra.Command{ Use: "up", Short: "Boot up the stack", + Args: cobra.NoArgs, RunE: upCommandAction, } upCommand.Flags().StringP(cobraext.DataStreamFlagName, "d", "", cobraext.DataStreamFlagDescription) diff --git a/cmd/testrunner.go b/cmd/testrunner.go index 73c33c7cb5..ccc95fdd05 100644 --- a/cmd/testrunner.go +++ b/cmd/testrunner.go @@ -82,6 +82,7 @@ func setupTestCommand() *cobraext.Command { Use: string(testType), Short: fmt.Sprintf("Run %s tests", runner.String()), Long: fmt.Sprintf("Run %s tests for the package.", runner.String()), + Args: cobra.NoArgs, RunE: action, } diff --git a/cmd/uninstall.go b/cmd/uninstall.go index b9736931ff..96cda27012 100644 --- a/cmd/uninstall.go +++ b/cmd/uninstall.go @@ -25,6 +25,7 @@ func setupUninstallCommand() *cobraext.Command { Use: "uninstall", Short: "Uninstall the package", Long: uninstallLongDescription, + Args: cobra.NoArgs, RunE: uninstallCommandAction, } diff --git a/cmd/version.go b/cmd/version.go index 1bce57b9ea..62e19d3d34 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -21,6 +21,7 @@ func setupVersionCommand() *cobraext.Command { Use: "version", Short: "Show application version", Long: versionLongDescription, + Args: cobra.NoArgs, RunE: versionCommandAction, }