From e8ed016312efc459122bd069c26bdeed1e87bdb2 Mon Sep 17 00:00:00 2001 From: Puskar Basu <45908484+pskrbasu@users.noreply.github.com> Date: Fri, 26 Apr 2024 17:15:01 +0530 Subject: [PATCH] Update usage help message for mod commands (#337) --- internal/cmd/check.go | 2 +- internal/cmd/dashboard.go | 7 ++++--- internal/cmd/mod.go | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/cmd/check.go b/internal/cmd/check.go index 7b2aad30..68673b65 100644 --- a/internal/cmd/check.go +++ b/internal/cmd/check.go @@ -80,7 +80,7 @@ func checkCmd[T controlinit.CheckTarget]() *cobra.Command { AddStringSliceFlag(constants.ArgExport, nil, "Export output to file, supported formats: csv, html, json, md, nunit3, sps (snapshot), asff"). AddStringSliceFlag(constants.ArgSearchPath, nil, "Set a custom search_path (comma-separated)"). AddStringSliceFlag(constants.ArgSearchPathPrefix, nil, "Set a prefix to the current search path (comma-separated)"). - AddIntFlag(constants.ArgBenchmarkTimeout, 0, "Set a the execution timeout") + AddIntFlag(constants.ArgBenchmarkTimeout, 0, "Set the benchmark execution timeout") // for control command, add --arg switch typeName { diff --git a/internal/cmd/dashboard.go b/internal/cmd/dashboard.go index ad495c2a..3cb7a728 100644 --- a/internal/cmd/dashboard.go +++ b/internal/cmd/dashboard.go @@ -5,6 +5,9 @@ import ( "encoding/json" "errors" "fmt" + "os" + "strings" + "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/thediveo/enumflag/v2" @@ -27,8 +30,6 @@ import ( "github.com/turbot/powerpipe/internal/dashboardexecute" "github.com/turbot/powerpipe/internal/initialisation" "github.com/turbot/steampipe-plugin-sdk/v5/logging" - "os" - "strings" ) // variable used to assign the output mode flag @@ -74,7 +75,7 @@ The current mod is the working directory, or the directory specified by the --mo // Cobra will interpret values passed to a StringSliceFlag as CSV, where args passed to StringArrayFlag are not parsed and used raw AddStringArrayFlag(constants.ArgVariable, nil, "Specify the value of a variable"). AddStringSliceFlag(constants.ArgVarFile, nil, "Specify an .ppvar file containing variable values"). - AddIntFlag(constants.ArgDashboardTimeout, 0, "Set a the dashboard execution timeout") + AddIntFlag(constants.ArgDashboardTimeout, 0, "Set the dashboard execution timeout") return cmd } diff --git a/internal/cmd/mod.go b/internal/cmd/mod.go index 5c006612..560a15ea 100644 --- a/internal/cmd/mod.go +++ b/internal/cmd/mod.go @@ -68,7 +68,7 @@ Examples: func modInstallCmd() *cobra.Command { var cmd = &cobra.Command{ - Use: "install", + Use: "install [flags] [mod-url]", Run: runModInstallCmd, Short: "Install one or more mods and their dependencies", Long: `Install one or more mods and their dependencies. @@ -170,7 +170,7 @@ func getPluginVersions(ctx context.Context) *modconfig.PluginVersionMap { func modUninstallCmd() *cobra.Command { var cmd = &cobra.Command{ - Use: "uninstall", + Use: "uninstall [flags] [mod-url]", Run: runModUninstallCmd, Short: "Uninstall a mod and its dependencies", Long: `Uninstall a mod and its dependencies. @@ -220,7 +220,7 @@ func runModUninstallCmd(cmd *cobra.Command, args []string) { func modUpdateCmd() *cobra.Command { var cmd = &cobra.Command{ - Use: "update", + Use: "update [flags] [mod-url]", Run: runModUpdateCmd, Short: "Update one or more mods and their dependencies", Long: `Update one or more mods and their dependencies.