Skip to content

Commit

Permalink
More consistent help commands
Browse files Browse the repository at this point in the history
- Align some wording
- Remove periods
- Fix some bad spacing

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Jun 2, 2024
1 parent 17e6205 commit a7071cc
Show file tree
Hide file tree
Showing 28 changed files with 121 additions and 121 deletions.
2 changes: 1 addition & 1 deletion apps/cnquery/cmd/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var embedQueryPackTemplate []byte
var queryPackInitCmd = &cobra.Command{
Use: "init [path]",
Short: "Create an example query pack",
Long: "Create an example query pack that you can use as a starting point. If you don't provide a filename, cnquery uses `example-pack.mql.yaml`.",
Long: "Create an example query pack that you can use as a starting point. If you don't provide a filename, cnquery uses `example-pack.mql.yaml`",
Args: cobra.MaximumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
name := "example-pack.mql.yaml"
Expand Down
16 changes: 8 additions & 8 deletions apps/cnquery/cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ import (

func init() {
rootCmd.AddCommand(LoginCmd)
LoginCmd.Flags().StringP("token", "t", "", "Set a client registration token.")
LoginCmd.Flags().StringToString("annotation", nil, "Set the client annotations.")
LoginCmd.Flags().String("name", "", "Set asset name.")
LoginCmd.Flags().String("api-endpoint", "", "Set the Mondoo API endpoint.")
LoginCmd.Flags().Int("timer", 0, "Set the scan interval in minutes.")
LoginCmd.Flags().Int("splay", 0, "Randomize the timer by up to this many minutes.")
LoginCmd.Flags().StringP("token", "t", "", "Set a client registration token")
LoginCmd.Flags().StringToString("annotation", nil, "Set the client annotations")
LoginCmd.Flags().String("name", "", "Set asset name")
LoginCmd.Flags().String("api-endpoint", "", "Set the Mondoo API endpoint")
LoginCmd.Flags().Int("timer", 0, "Set the scan interval in minutes")
LoginCmd.Flags().Int("splay", 0, "Randomize the timer by up to this many minutes")
}

var LoginCmd = &cobra.Command{
Use: "login",
Aliases: []string{"register"},
Short: "Register with Mondoo Platform",
Long: `
Log in to Mondoo Platform using a registration token. To pass in the token, use
Log in to Mondoo Platform using a registration token. To pass in the token, use
the '--token' flag.
You can generate a new registration token on the Mondoo Dashboard. Go to
https://console.mondoo.com -> Space -> Settings -> Registration Token. Copy the token and pass it in
https://console.mondoo.com -> Space -> Settings -> Registration Token. Copy the token and pass it in
using the '--token' argument.
You remain logged in until you explicitly log out using the 'logout' subcommand.
Expand Down
6 changes: 3 additions & 3 deletions apps/cnquery/cmd/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func init() {
var ProvidersCmd = &cobra.Command{
Use: "providers",
Short: "Providers add connectivity to all assets",
Long: `Manage your providers. List and install new ones or update existing ones.`,
Long: `Manage your providers. List and install new ones or update existing ones`,
PreRun: func(cmd *cobra.Command, args []string) {},
Run: func(cmd *cobra.Command, args []string) {
list()
Expand All @@ -40,7 +40,7 @@ var ProvidersCmd = &cobra.Command{

var listProvidersCmd = &cobra.Command{
Use: "list",
Short: "List all providers on the system.",
Short: "List all providers on the system",
Long: "",
PreRun: func(cmd *cobra.Command, args []string) {},
Run: func(cmd *cobra.Command, args []string) {
Expand All @@ -50,7 +50,7 @@ var listProvidersCmd = &cobra.Command{

var installProviderCmd = &cobra.Command{
Use: "install <NAME[@VERSION]>",
Short: "Install or update a provider.",
Short: "Install or update a provider",
Long: "",
PreRun: func(cmd *cobra.Command, args []string) {},
Run: func(cmd *cobra.Command, args []string) {
Expand Down
2 changes: 1 addition & 1 deletion apps/cnquery/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func init() {

rootCmd.PersistentFlags().BoolP("verbose", "v", false, "Enable verbose output")
rootCmd.PersistentFlags().String("log-level", "info", "Set log level: error, warn, info, debug, trace")
rootCmd.PersistentFlags().String("api-proxy", "", "Set proxy for communications with Mondoo API")
rootCmd.PersistentFlags().String("api-proxy", "", "Set proxy for communications with Mondoo Platform API")
rootCmd.PersistentFlags().Bool("auto-update", true, "Enable automatic provider installation and update")
viper.BindPFlag("verbose", rootCmd.PersistentFlags().Lookup("verbose"))
viper.BindPFlag("log-level", rootCmd.PersistentFlags().Lookup("log-level"))
Expand Down
14 changes: 7 additions & 7 deletions apps/cnquery/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ import (
func init() {
rootCmd.AddCommand(RunCmd)

RunCmd.Flags().StringP("command", "c", "", "MQL query to executed in the shell.")
RunCmd.Flags().Bool("parse", false, "Parse the query and return the logical structure.")
RunCmd.Flags().Bool("ast", false, "Parse the query and return the abstract syntax tree (AST).")
RunCmd.Flags().Bool("info", false, "Parse the query and provide information about it.")
RunCmd.Flags().BoolP("json", "j", false, "Run the query and return the object in a JSON structure.")
RunCmd.Flags().String("platform-id", "", "Select a specific target asset by providing its platform ID.")
RunCmd.Flags().StringP("command", "c", "", "MQL query to executed in the shell")
RunCmd.Flags().Bool("parse", false, "Parse the query and return the logical structure")
RunCmd.Flags().Bool("ast", false, "Parse the query and return the abstract syntax tree (AST)")
RunCmd.Flags().Bool("info", false, "Parse the query and provide information about it")
RunCmd.Flags().BoolP("json", "j", false, "Run the query and return the object in a JSON structure")
RunCmd.Flags().String("platform-id", "", "Select a specific target asset by providing its platform ID")

RunCmd.Flags().String("llx", "", "Generate the executable code bundle and save it to the specified file.")
RunCmd.Flags().String("llx", "", "Generate the executable code bundle and save it to the specified file")
RunCmd.Flags().MarkHidden("llx")
RunCmd.Flags().String("use-llx", "", "Run the code specified in the code bundle on disk")
_ = RunCmd.Flags().MarkHidden("use-llx")
Expand Down
6 changes: 3 additions & 3 deletions apps/cnquery/cmd/sbom.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (

func init() {
rootCmd.AddCommand(sbomCmd)
sbomCmd.Flags().String("asset-name", "", "User-override for the asset name.")
sbomCmd.Flags().StringToString("annotation", nil, "Add an annotation to the asset.") // user-added, editable
sbomCmd.Flags().String("asset-name", "", "User-override for the asset name")
sbomCmd.Flags().StringToString("annotation", nil, "Add an annotation to the asset") // user-added, editable
sbomCmd.Flags().StringP("output", "o", "list", "Set output format: "+sbom.AllFormats())
sbomCmd.Flags().String("output-target", "", "Set output target to which the sbom report will be written.")
sbomCmd.Flags().String("output-target", "", "Set output target to which the SBOM report will be written")
sbomCmd.Flags().Bool("with-evidence", false, "Display evidence for each component")
}

Expand Down
26 changes: 13 additions & 13 deletions apps/cnquery/cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,41 +27,41 @@ func init() {
rootCmd.AddCommand(scanCmd)

_ = scanCmd.Flags().StringP("output", "o", "compact", "Set output format: "+reporter.AllFormats())
_ = scanCmd.Flags().BoolP("json", "j", false, "Run the query and return the object in a JSON structure.")
_ = scanCmd.Flags().String("platform-id", "", "Select a specific target asset by providing its platform ID.")
_ = scanCmd.Flags().BoolP("json", "j", false, "Run the query and return the object in a JSON structure")
_ = scanCmd.Flags().String("platform-id", "", "Select a specific target asset by providing its platform ID")

_ = scanCmd.Flags().String("inventory-file", "", "Set the path to the inventory file.")
_ = scanCmd.Flags().String("inventory-template", "", "Set the path to the inventory template.")
_ = scanCmd.Flags().String("inventory-file", "", "Set the path to the inventory file")
_ = scanCmd.Flags().String("inventory-template", "", "Set the path to the inventory template")
_ = scanCmd.Flags().MarkHidden("inventory-template")

_ = scanCmd.Flags().Bool("inventory-format-ansible", false, "Set the inventory format to Ansible.")
_ = scanCmd.Flags().Bool("inventory-format-ansible", false, "Set the inventory format to Ansible")
// "inventory-ansible" is deprecated, use "inventory-format-ansible" instead
_ = scanCmd.Flags().Bool("inventory-ansible", false, "Set the inventory format to Ansible.")
_ = scanCmd.Flags().Bool("inventory-ansible", false, "Set the inventory format to Ansible")
_ = scanCmd.Flags().MarkDeprecated("inventory-ansible", "use --inventory-format-ansible")
_ = scanCmd.Flags().MarkHidden("inventory-ansible")

_ = scanCmd.Flags().Bool("inventory-format-domainlist", false, "Set the inventory format to domain list.")
_ = scanCmd.Flags().Bool("inventory-format-domainlist", false, "Set the inventory format to domain list")
// "inventory-domainlist" is deprecated, use "inventory-format-domainlist" instead
_ = scanCmd.Flags().Bool("inventory-domainlist", false, "Set the inventory format to domain list.")
_ = scanCmd.Flags().Bool("inventory-domainlist", false, "Set the inventory format to domain list")
_ = scanCmd.Flags().MarkDeprecated("inventory-domainlist", "use --inventory-format-domainlist")
_ = scanCmd.Flags().MarkHidden("inventory-domainlist")

// bundles, packs & incognito mode
_ = scanCmd.Flags().Bool("incognito", false, "Run in incognito mode. Do not report scan results to Mondoo Platform.")
_ = scanCmd.Flags().StringSlice("querypack", nil, "Set the query packs to execute. This requires `querypack-bundle`. You can specify multiple UIDs.")
_ = scanCmd.Flags().Bool("incognito", false, "Run in incognito mode. Do not report scan results to Mondoo Platform")
_ = scanCmd.Flags().StringSlice("querypack", nil, "Set the query packs to execute. This requires `querypack-bundle`. You can specify multiple UIDs")
_ = scanCmd.Flags().StringSliceP("querypack-bundle", "f", nil, "Path to local query pack file")
// flag completion command
_ = scanCmd.RegisterFlagCompletionFunc("querypack", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return getQueryPacksForCompletion(), cobra.ShellCompDirectiveDefault
})
_ = scanCmd.Flags().String("asset-name", "", "User-override for the asset name")
_ = scanCmd.Flags().StringToString("annotation", nil, "Add an annotation to the asset.") // user-added, editable
_ = scanCmd.Flags().StringToString("annotation", nil, "Add an annotation to the asset") // user-added, editable
_ = scanCmd.Flags().StringToString("props", nil, "Custom values for properties")
_ = scanCmd.Flags().String("trace-id", "", "Trace identifier")

// v6 should make detect-cicd and category flag public
_ = scanCmd.Flags().Bool("detect-cicd", true, "Try to detect CI/CD environments. If detected, set the asset category to 'cicd'.")
_ = scanCmd.Flags().String("category", "inventory", "Set the category for the assets to 'inventory|cicd'.")
_ = scanCmd.Flags().Bool("detect-cicd", true, "Try to detect CI/CD environments. If detected, set the asset category to 'cicd'")
_ = scanCmd.Flags().String("category", "inventory", "Set the category for the assets to 'inventory|cicd'")
_ = scanCmd.Flags().MarkHidden("category")
}

Expand Down
4 changes: 2 additions & 2 deletions apps/cnquery/cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
func init() {
rootCmd.AddCommand(shellCmd)

shellCmd.Flags().StringP("command", "c", "", "MQL query to executed in the shell.")
shellCmd.Flags().String("platform-id", "", "Select a specific target asset by providing its platform ID.")
shellCmd.Flags().StringP("command", "c", "", "MQL query to executed in the shell")
shellCmd.Flags().String("platform-id", "", "Select a specific target asset by providing its platform ID")
shellCmd.Flags().StringToString("annotations", nil, "Specify annotations for this run")
_ = shellCmd.Flags().MarkHidden("annotations")
}
Expand Down
4 changes: 2 additions & 2 deletions apps/cnquery/cmd/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ func init() {

vaultConfigureCmd.Flags().String("type", "", "possible values: "+strings.Join(vault.TypeIds(), " | "))
vaultConfigureCmd.Flags().StringToString("option", nil, "addition vault connection options, multiple options via --option key=value")
vaultConfigureCmd.Flags().String("inventory-file", "", "Set the path to the inventory file.")
vaultConfigureCmd.Flags().String("inventory-file", "", "Set the path to the inventory file")
VaultCmd.AddCommand(vaultConfigureCmd)

VaultCmd.AddCommand(vaultRemoveCmd)
VaultCmd.AddCommand(vaultResetCmd)

vaultAddSecretCmd.Flags().String("inventory-file", "", "Set the path to the inventory file.")
vaultAddSecretCmd.Flags().String("inventory-file", "", "Set the path to the inventory file")
vaultAddSecretCmd.MarkFlagRequired("inventory-file")
VaultCmd.AddCommand(vaultAddSecretCmd)

Expand Down
2 changes: 1 addition & 1 deletion cli/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ type CommonOpts struct {
// client features
Features []string `json:"features,omitempty" mapstructure:"features"`

// API Proxy for communicating with Mondoo API
// API Proxy for communicating with Mondoo Platform API
APIProxy string `json:"api_proxy,omitempty" mapstructure:"api_proxy"`

// labels that will be applied to all assets
Expand Down
10 changes: 5 additions & 5 deletions providers/atlassian/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,31 @@ For SCIM, you receive both the token and the directory-id from Atlassian when yo
Long: "admin-token",
Type: plugin.FlagType_String,
Default: "",
Desc: "Provide Atlassian admin API token (used for Atlassian admin).",
Desc: "Atlassian admin API token (used for Atlassian admin)",
},
{
Long: "host",
Type: plugin.FlagType_String,
Default: "",
Desc: "Provide Atlassian hostname (e.g. https://example.atlassian.net).",
Desc: "Atlassian hostname (e.g. https://example.atlassian.net)",
},
{
Long: "user",
Type: plugin.FlagType_String,
Default: "",
Desc: "Provide Atlassian user name (e.g. [email protected]).",
Desc: "Atlassian user name (e.g. [email protected])",
},
{
Long: "user-token",
Type: plugin.FlagType_String,
Default: "",
Desc: "Provide Atlassian user API token (used for Jira / Confluence).",
Desc: "Atlassian user API token (used for Jira / Confluence)",
},
{
Long: "scim-token",
Type: plugin.FlagType_String,
Default: "",
Desc: "Provide Atlassian SCIM API token (used for SCIM).",
Desc: "Atlassian SCIM API token (used for SCIM)",
},
},
},
Expand Down
16 changes: 8 additions & 8 deletions providers/azure/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,56 +46,56 @@ var Config = plugin.Provider{
Long: "tenant-id",
Type: plugin.FlagType_String,
Default: "",
Desc: "Directory (tenant) ID of the service principal.",
Desc: "Directory (tenant) ID of the service principal",
Option: plugin.FlagOption_Hidden,
},
{
Long: "client-id",
Type: plugin.FlagType_String,
Default: "",
Desc: "Application (client) ID of the service principal.",
Desc: "Application (client) ID of the service principal",
Option: plugin.FlagOption_Hidden,
},
{
Long: "client-secret",
Type: plugin.FlagType_String,
Default: "",
Desc: "Secret for application.",
Desc: "Secret for application",
Option: plugin.FlagOption_Hidden,
},
{
Long: "certificate-path",
Type: plugin.FlagType_String,
Default: "",
Desc: "Path (in PKCS #12/PFX or PEM format) to the authentication certificate.",
Desc: "Path (in PKCS #12/PFX or PEM format) to the authentication certificate",
Option: plugin.FlagOption_Hidden,
},
{
Long: "certificate-secret",
Type: plugin.FlagType_String,
Default: "",
Desc: "Passphrase for the authentication certificate file.",
Desc: "Passphrase for the authentication certificate file",
Option: plugin.FlagOption_Hidden,
},
{
Long: "subscription",
Type: plugin.FlagType_String,
Default: "",
Desc: "ID of the Azure subscription to scan.",
Desc: "ID of the Azure subscription to scan",
Option: plugin.FlagOption_Hidden,
},
{
Long: "subscriptions",
Type: plugin.FlagType_String,
Default: "",
Desc: "Comma-separated list of Azure subscriptions to include.",
Desc: "Comma-separated list of Azure subscriptions to include",
Option: plugin.FlagOption_Hidden,
},
{
Long: "subscriptions-exclude",
Type: plugin.FlagType_String,
Default: "",
Desc: "Comma-separated list of Azure subscriptions to exclude.",
Desc: "Comma-separated list of Azure subscriptions to exclude",
Option: plugin.FlagOption_Hidden,
},
},
Expand Down
4 changes: 2 additions & 2 deletions providers/equinix/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var Config = plugin.Provider{
Name: "equinix",
Use: "equinix [org <org id>] [project <project-id>] [--token <token>]",
Short: "an Equinix Metal organization",
Long: `equinix is designed for querying resources within a specified
Long: `equinix is designed for querying resources within a specified
project or organization on the Equinix Metal platform.
Available Commands:
Expand All @@ -35,7 +35,7 @@ If the PACKET_AUTH_TOKEN environment variable is set, the token flag is not requ
Long: "token",
Type: plugin.FlagType_String,
Default: "",
Desc: " Specifies the Equinix API token for authenticating the user",
Desc: "The Equinix API token for authenticating the user",
},
},
},
Expand Down
14 changes: 7 additions & 7 deletions providers/github/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,43 @@ var Config = plugin.Provider{
Long: "token",
Type: plugin.FlagType_String,
Default: "",
Desc: "Provide GitHub personal access token.",
Desc: "GitHub personal access token",
},
{
Long: "repos-exclude",
Type: plugin.FlagType_String,
Default: "",
Desc: "Filter out repositories matching these names.",
Desc: "Filter out repositories matching these names",
},
{
Long: "repos",
Type: plugin.FlagType_String,
Default: "",
Desc: "Only include repositories with matching names.",
Desc: "Only include repositories with matching names",
},
{
Long: "app-id",
Type: plugin.FlagType_String,
Default: "",
Desc: "GitHub App ID.",
Desc: "GitHub App ID",
},
{
Long: "app-installation-id",
Type: plugin.FlagType_String,
Default: "",
Desc: "GitHub App installation ID.",
Desc: "GitHub App installation ID",
},
{
Long: "app-private-key",
Type: plugin.FlagType_String,
Default: "",
Desc: "GitHub App private key file path.",
Desc: "GitHub App private key file path",
},
{
Long: "enterprise-url",
Type: plugin.FlagType_String,
Default: "",
Desc: "GitHub Enterprise URL.",
Desc: "GitHub Enterprise URL",
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion providers/gitlab/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var Config = plugin.Provider{
Long: "token",
Type: plugin.FlagType_String,
Default: "",
Desc: "Provide GitLab personal access token.",
Desc: "GitLab personal access token",
},
{
Long: "group",
Expand Down
Loading

0 comments on commit a7071cc

Please sign in to comment.