diff --git a/completers/glab_completer/cmd/alias.go b/completers/glab_completer/cmd/alias.go index afd7b938db..1e9d1940df 100644 --- a/completers/glab_completer/cmd/alias.go +++ b/completers/glab_completer/cmd/alias.go @@ -7,7 +7,7 @@ import ( var aliasCmd = &cobra.Command{ Use: "alias [command] [flags]", - Short: "Create, list and delete aliases", + Short: "Create, list, and delete aliases.", Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/alias_set.go b/completers/glab_completer/cmd/alias_set.go index d1eba6bb27..d8dd983674 100644 --- a/completers/glab_completer/cmd/alias_set.go +++ b/completers/glab_completer/cmd/alias_set.go @@ -8,14 +8,14 @@ import ( var alias_setCmd = &cobra.Command{ Use: "set '' [flags]", - Short: "Set an alias.", + Short: "Set an alias for a longer command.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(alias_setCmd).Standalone() - alias_setCmd.Flags().BoolP("shell", "s", false, "Declare an alias to be passed through a shell interpreter") + alias_setCmd.Flags().BoolP("shell", "s", false, "Declare an alias to be passed through a shell interpreter.") aliasCmd.AddCommand(alias_setCmd) carapace.Gen(alias_setCmd).PositionalCompletion( diff --git a/completers/glab_completer/cmd/api.go b/completers/glab_completer/cmd/api.go index a4fc488100..6992afd195 100644 --- a/completers/glab_completer/cmd/api.go +++ b/completers/glab_completer/cmd/api.go @@ -9,22 +9,22 @@ import ( var apiCmd = &cobra.Command{ Use: "api ", - Short: "Make an authenticated request to GitLab API", + Short: "Make an authenticated request to the GitLab API.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(apiCmd).Standalone() - apiCmd.Flags().StringSliceP("field", "F", []string{}, "Add a parameter of inferred type (changes default HTTP method to \"POST\")") - apiCmd.Flags().StringSliceP("header", "H", []string{}, "Add an additional HTTP request header") - apiCmd.Flags().String("hostname", "", "The GitLab hostname for the request (default is \"gitlab.com\" or authenticated host in current git directory)") - apiCmd.Flags().BoolP("include", "i", false, "Include HTTP response headers in the output") - apiCmd.Flags().String("input", "", "The file to use as body for the HTTP request") - apiCmd.Flags().StringP("method", "X", "", "The HTTP method for the request") - apiCmd.Flags().Bool("paginate", false, "Make additional HTTP requests to fetch all pages of results") - apiCmd.Flags().StringSliceP("raw-field", "f", []string{}, "Add a string parameter") - apiCmd.Flags().Bool("silent", false, "Do not print the response body") + apiCmd.Flags().StringSliceP("field", "F", []string{}, "Add a parameter of inferred type. Changes the default HTTP method to \"POST\".") + apiCmd.Flags().StringSliceP("header", "H", []string{}, "Add an additional HTTP request header.") + apiCmd.Flags().String("hostname", "", "The GitLab hostname for the request. Defaults to \"gitlab.com\", or the authenticated host in the current Git directory.") + apiCmd.Flags().BoolP("include", "i", false, "Include HTTP response headers in the output.") + apiCmd.Flags().String("input", "", "The file to use as the body for the HTTP request.") + apiCmd.Flags().StringP("method", "X", "", "The HTTP method for the request.") + apiCmd.Flags().Bool("paginate", false, "Make additional HTTP requests to fetch all pages of results.") + apiCmd.Flags().StringSliceP("raw-field", "f", []string{}, "Add a string parameter.") + apiCmd.Flags().Bool("silent", false, "Do not print the response body.") rootCmd.AddCommand(apiCmd) carapace.Gen(apiCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/ask.go b/completers/glab_completer/cmd/ask.go deleted file mode 100644 index c71b569b92..0000000000 --- a/completers/glab_completer/cmd/ask.go +++ /dev/null @@ -1,18 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var askCmd = &cobra.Command{ - Use: "ask prompt", - Short: "Generate terminal commands from natural language. (Experimental.)", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(askCmd).Standalone() - - rootCmd.AddCommand(askCmd) -} diff --git a/completers/glab_completer/cmd/ask_git.go b/completers/glab_completer/cmd/ask_git.go deleted file mode 100644 index 0bc46a08cd..0000000000 --- a/completers/glab_completer/cmd/ask_git.go +++ /dev/null @@ -1,18 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var ask_gitCmd = &cobra.Command{ - Use: "git ", - Short: "Generate Git commands from natural language (Experimental).", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(ask_gitCmd).Standalone() - - askCmd.AddCommand(ask_gitCmd) -} diff --git a/completers/glab_completer/cmd/auth.go b/completers/glab_completer/cmd/auth.go index 22ade25b68..f1aca9f171 100644 --- a/completers/glab_completer/cmd/auth.go +++ b/completers/glab_completer/cmd/auth.go @@ -7,7 +7,7 @@ import ( var authCmd = &cobra.Command{ Use: "auth ", - Short: "Manage glab's authentication state", + Short: "Manage glab's authentication state.", Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/auth_gitCredential.go b/completers/glab_completer/cmd/auth_gitCredential.go index 00595ef0e0..b268bdad81 100644 --- a/completers/glab_completer/cmd/auth_gitCredential.go +++ b/completers/glab_completer/cmd/auth_gitCredential.go @@ -7,7 +7,7 @@ import ( var auth_gitCredentialCmd = &cobra.Command{ Use: "git-credential", - Short: "Implements Git credential helper manager", + Short: "Implements Git credential helper manager.", Hidden: true, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/auth_login.go b/completers/glab_completer/cmd/auth_login.go index 59f9c9bed4..7b9e77072f 100644 --- a/completers/glab_completer/cmd/auth_login.go +++ b/completers/glab_completer/cmd/auth_login.go @@ -8,17 +8,17 @@ import ( var auth_loginCmd = &cobra.Command{ Use: "login", - Short: "Authenticate with a GitLab instance", + Short: "Authenticate with a GitLab instance.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(auth_loginCmd).Standalone() - auth_loginCmd.Flags().StringP("hostname", "h", "", "The hostname of the GitLab instance to authenticate with") - auth_loginCmd.Flags().Bool("stdin", false, "Read token from standard input") - auth_loginCmd.Flags().StringP("token", "t", "", "Your GitLab access token") - auth_loginCmd.Flags().Bool("use-keyring", false, "Store token in your operating system's keyring") + auth_loginCmd.Flags().StringP("hostname", "h", "", "The hostname of the GitLab instance to authenticate with.") + auth_loginCmd.Flags().Bool("stdin", false, "Read token from standard input.") + auth_loginCmd.Flags().StringP("token", "t", "", "Your GitLab access token.") + auth_loginCmd.Flags().Bool("use-keyring", false, "Store token in your operating system's keyring.") authCmd.AddCommand(auth_loginCmd) carapace.Gen(auth_loginCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/auth_status.go b/completers/glab_completer/cmd/auth_status.go index dd7797286c..9119b46c82 100644 --- a/completers/glab_completer/cmd/auth_status.go +++ b/completers/glab_completer/cmd/auth_status.go @@ -8,15 +8,15 @@ import ( var auth_statusCmd = &cobra.Command{ Use: "status", - Short: "View authentication status", + Short: "View authentication status.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(auth_statusCmd).Standalone() - auth_statusCmd.Flags().StringP("hostname", "h", "", "Check a specific instance's authentication status") - auth_statusCmd.Flags().BoolP("show-token", "t", false, "Display the auth token") + auth_statusCmd.Flags().StringP("hostname", "h", "", "Check a specific instance's authentication status.") + auth_statusCmd.Flags().BoolP("show-token", "t", false, "Display the authentication token.") authCmd.AddCommand(auth_statusCmd) carapace.Gen(auth_statusCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/changelog.go b/completers/glab_completer/cmd/changelog.go index 77317eafc1..0e1fc91603 100644 --- a/completers/glab_completer/cmd/changelog.go +++ b/completers/glab_completer/cmd/changelog.go @@ -7,7 +7,7 @@ import ( var changelogCmd = &cobra.Command{ Use: "changelog [flags]", - Short: "Interact with the changelog API", + Short: "Interact with the changelog API.", Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/changelog_generate.go b/completers/glab_completer/cmd/changelog_generate.go index 94819eb885..9b0097ac28 100644 --- a/completers/glab_completer/cmd/changelog_generate.go +++ b/completers/glab_completer/cmd/changelog_generate.go @@ -8,19 +8,19 @@ import ( var changelog_generateCmd = &cobra.Command{ Use: "generate [flags]", - Short: "Generate a changelog for the repository/project", + Short: "Generate a changelog for the repository or project.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(changelog_generateCmd).Standalone() - changelog_generateCmd.Flags().String("config-file", "", "The path of changelog configuration file in the project's Git repository. Defaults to .gitlab/changelog_config.yml.") - changelog_generateCmd.Flags().String("date", "", "The date and time of the release. Uses ISO 8601 (2016-03-11T03:45:40Z) format. Defaults to the current time.") - changelog_generateCmd.Flags().String("from", "", "The start of the range of commits (as a SHA) to use for generating the changelog. This commit itself isn't included in the list.") - changelog_generateCmd.Flags().String("to", "", "The end of the range of commits (as a SHA) to use for the changelog. This commit is included in the list. Defaults to the HEAD of the default project branch.") - changelog_generateCmd.Flags().String("trailer", "", "The Git trailer to use for including commits. Defaults to Changelog.") - changelog_generateCmd.Flags().StringP("version", "v", "", "The version to generate the changelog for. The format must follow semantic versioning. Defaults to the version of the local checkout (like using git describe).") + changelog_generateCmd.Flags().String("config-file", "", "Path of the changelog configuration file in the project's Git repository. Defaults to '.gitlab/changelog_config.yml'.") + changelog_generateCmd.Flags().String("date", "", "Date and time of the release. Uses ISO 8601 (`2016-03-11T03:45:40Z`) format. Defaults to the current time.") + changelog_generateCmd.Flags().String("from", "", "Start of the range of commits (as a SHA) to use when generating the changelog. This commit itself isn't included in the list.") + changelog_generateCmd.Flags().String("to", "", "End of the range of commits (as a SHA) to use when generating the changelog. This commit is included in the list. Defaults to the HEAD of the project's default branch.") + changelog_generateCmd.Flags().String("trailer", "", "The Git trailer to use for including commits. Defaults to 'Changelog'.") + changelog_generateCmd.Flags().StringP("version", "v", "", "Version to generate the changelog for. Must follow semantic versioning. Defaults to the version of the local checkout, like using 'git describe'.") changelogCmd.AddCommand(changelog_generateCmd) carapace.Gen(changelog_generateCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/checkUpdate.go b/completers/glab_completer/cmd/checkUpdate.go index 38064df22f..bbbf19230b 100644 --- a/completers/glab_completer/cmd/checkUpdate.go +++ b/completers/glab_completer/cmd/checkUpdate.go @@ -7,7 +7,7 @@ import ( var checkUpdateCmd = &cobra.Command{ Use: "check-update", - Short: "Check for latest glab releases", + Short: "Check for latest glab releases.", Aliases: []string{"update"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/ci.go b/completers/glab_completer/cmd/ci.go index ade979a370..0ea34e6fd6 100644 --- a/completers/glab_completer/cmd/ci.go +++ b/completers/glab_completer/cmd/ci.go @@ -8,7 +8,7 @@ import ( var ciCmd = &cobra.Command{ Use: "ci [flags]", - Short: "Work with GitLab CI/CD pipelines and jobs", + Short: "Work with GitLab CI/CD pipelines and jobs.", Aliases: []string{"pipe", "pipeline"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,7 +16,7 @@ var ciCmd = &cobra.Command{ func init() { carapace.Gen(ciCmd).Standalone() - ciCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + ciCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") rootCmd.AddCommand(ciCmd) carapace.Gen(ciCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/ci_artifact.go b/completers/glab_completer/cmd/ci_artifact.go deleted file mode 100644 index 0a176c1e58..0000000000 --- a/completers/glab_completer/cmd/ci_artifact.go +++ /dev/null @@ -1,26 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var ci_artifactCmd = &cobra.Command{ - Use: "artifact [flags]", - Short: "Download all artifacts from the last pipeline", - Aliases: []string{"push"}, - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(ci_artifactCmd).Standalone() - - ci_artifactCmd.Flags().StringP("path", "p", "", "Path to download the artifact files") - ciCmd.AddCommand(ci_artifactCmd) - - carapace.Gen(ci_artifactCmd).FlagCompletion(carapace.ActionMap{ - "path": carapace.ActionFiles(), - }) - - // TODO positional completion -} diff --git a/completers/glab_completer/cmd/ci_config.go b/completers/glab_completer/cmd/ci_config.go new file mode 100644 index 0000000000..9ff5cb207b --- /dev/null +++ b/completers/glab_completer/cmd/ci_config.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var ci_configCmd = &cobra.Command{ + Use: "config [flags]", + Short: "Work with GitLab CI/CD configuration.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(ci_configCmd).Standalone() + + ciCmd.AddCommand(ci_configCmd) +} diff --git a/completers/glab_completer/cmd/ci_config_compile.go b/completers/glab_completer/cmd/ci_config_compile.go new file mode 100644 index 0000000000..9e8040696c --- /dev/null +++ b/completers/glab_completer/cmd/ci_config_compile.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var ci_config_compileCmd = &cobra.Command{ + Use: "compile", + Short: "View the fully expanded CI/CD configuration.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(ci_config_compileCmd).Standalone() + + ci_configCmd.AddCommand(ci_config_compileCmd) +} diff --git a/completers/glab_completer/cmd/ci_delete.go b/completers/glab_completer/cmd/ci_delete.go index 744eb95ff4..3dc12d0a77 100644 --- a/completers/glab_completer/cmd/ci_delete.go +++ b/completers/glab_completer/cmd/ci_delete.go @@ -3,24 +3,56 @@ package cmd import ( "github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace-bin/completers/glab_completer/cmd/action" + "github.com/carapace-sh/carapace/pkg/style" "github.com/spf13/cobra" ) var ci_deleteCmd = &cobra.Command{ Use: "delete [flags]", - Short: "Delete a CI/CD pipeline", + Short: "Delete CI/CD pipelines.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(ci_deleteCmd).Standalone() - ci_deleteCmd.Flags().Bool("dry-run", false, "simulate process, but do not delete anything") - ci_deleteCmd.Flags().StringP("status", "s", "", "delete pipelines by status: {running|pending|success|failed|canceled|skipped|created|manual}") + ci_deleteCmd.Flags().Bool("dry-run", false, "Simulate process, but do not delete anything.") + ci_deleteCmd.Flags().String("older-than", "", "Filter pipelines older than the given duration. Valid units: h, m, s, ms, us, ns.") + ci_deleteCmd.Flags().String("page", "", "Page number.") + ci_deleteCmd.Flags().Bool("paginate", false, "Make additional HTTP requests to fetch all pages of projects before cloning. Respects '--per-page'.") + ci_deleteCmd.Flags().String("per-page", "", "Number of items to list per page.") + ci_deleteCmd.Flags().String("source", "", "Filter pipelines by source: api, chat, external, external_pull_request_event, merge_request_event, ondemand_dast_scan, ondemand_dast_validation, parent_pipeline, pipeline, push, schedule, security_orchestration_policy, trigger, web, webide.") + ci_deleteCmd.Flags().StringP("status", "s", "", "Delete pipelines by status: running, pending, success, failed, canceled, skipped, created, manual.") ciCmd.AddCommand(ci_deleteCmd) carapace.Gen(ci_deleteCmd).FlagCompletion(carapace.ActionMap{ - "status": carapace.ActionValues("running", "pending", "success", "failed", "canceled", "skipped", "created", "manual"), + "source": carapace.ActionValues( + "api", + "chat", + "external", + "external_pull_request_event", + "merge_request_event", + "ondemand_dast_scan", + "ondemand_dast_validation", + "parent_pipeline", + "pipeline", + "push", + "schedule", + "security_orchestration_policy", + "trigger", + "web", + "webide", + ), + "status": carapace.ActionValues( + "running", + "pending", + "success", + "failed", + "canceled", + "skipped", + "created", + "manual", + ).StyleF(style.ForKeyword), }) carapace.Gen(ci_deleteCmd).PositionalCompletion( diff --git a/completers/glab_completer/cmd/ci_get.go b/completers/glab_completer/cmd/ci_get.go index d048595192..51d5082983 100644 --- a/completers/glab_completer/cmd/ci_get.go +++ b/completers/glab_completer/cmd/ci_get.go @@ -8,7 +8,7 @@ import ( var ci_getCmd = &cobra.Command{ Use: "get [flags]", - Short: "Get JSON of a running CI/CD pipeline on the current or other specified branch", + Short: "Get JSON of a running CI/CD pipeline on the current or other specified branch.", Aliases: []string{"stats"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,15 +16,19 @@ var ci_getCmd = &cobra.Command{ func init() { carapace.Gen(ci_getCmd).Standalone() - ci_getCmd.Flags().StringP("branch", "b", "", "Check pipeline status for a branch. (Default is current branch)") - ci_getCmd.Flags().StringP("output-format", "o", "", "Format output as: text, json") - ci_getCmd.Flags().StringP("pipeline-id", "p", "", "Provide pipeline ID") - ci_getCmd.Flags().Bool("with-variables", false, "Show variables in pipeline (maintainer role required)") + ci_getCmd.Flags().StringP("branch", "b", "", "Check pipeline status for a branch. (Default: current branch)") + ci_getCmd.Flags().StringP("output", "F", "", "Format output. Options: text, json.") + ci_getCmd.Flags().StringP("output-format", "o", "", "Use output.") + ci_getCmd.Flags().StringP("pipeline-id", "p", "", "Provide pipeline ID.") + ci_getCmd.Flags().BoolP("with-job-details", "d", false, "Show extended job information.") + ci_getCmd.Flags().Bool("with-variables", false, "Show variables in pipeline. Requires the Maintainer role.") + ci_getCmd.Flag("output-format").Hidden = true ciCmd.AddCommand(ci_getCmd) carapace.Gen(ci_getCmd).FlagCompletion(carapace.ActionMap{ "branch": action.ActionBranches(ci_getCmd), + "output": carapace.ActionValues("text", "json"), "output-format": carapace.ActionValues("text", "json"), - "pipeline-id": action.ActionPipelines(ci_getCmd, "running"), + "pipeline-id": action.ActionPipelines(ci_getCmd, ""), }) } diff --git a/completers/glab_completer/cmd/ci_lint.go b/completers/glab_completer/cmd/ci_lint.go index cd3a08697c..00cc0fd4ff 100644 --- a/completers/glab_completer/cmd/ci_lint.go +++ b/completers/glab_completer/cmd/ci_lint.go @@ -2,6 +2,7 @@ package cmd import ( "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/glab_completer/cmd/action" "github.com/spf13/cobra" ) @@ -14,8 +15,15 @@ var ci_lintCmd = &cobra.Command{ func init() { carapace.Gen(ci_lintCmd).Standalone() + ci_lintCmd.Flags().Bool("dry-run", false, "Run pipeline creation simulation.") + ci_lintCmd.Flags().Bool("include-jobs", false, "Response includes the list of jobs that would exist in a static check or pipeline simulation.") + ci_lintCmd.Flags().String("ref", "", "When 'dry-run' is true, sets the branch or tag context for validating the CI/CD YAML configuration.") ciCmd.AddCommand(ci_lintCmd) + carapace.Gen(ci_lintCmd).FlagCompletion(carapace.ActionMap{ + "ref": action.ActionBranches(ci_lintCmd), // TODO refs + }) + carapace.Gen(ci_lintCmd).PositionalCompletion( carapace.ActionFiles(".gitlab-ci.yml"), ) diff --git a/completers/glab_completer/cmd/ci_list.go b/completers/glab_completer/cmd/ci_list.go index 330c53936b..a234490fa5 100644 --- a/completers/glab_completer/cmd/ci_list.go +++ b/completers/glab_completer/cmd/ci_list.go @@ -7,22 +7,24 @@ import ( var ci_listCmd = &cobra.Command{ Use: "list [flags]", - Short: "Get the list of CI/CD pipelines", + Short: "Get the list of CI/CD pipelines.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(ci_listCmd).Standalone() - ci_listCmd.Flags().StringP("orderBy", "o", "", "Order pipeline by {id|status|ref|updated_at|user_id}") - ci_listCmd.Flags().StringP("page", "p", "", "Page number") - ci_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page") - ci_listCmd.Flags().String("sort", "", "Sort pipeline by {asc|desc}") - ci_listCmd.Flags().StringP("status", "s", "", "Get pipeline with status: {running|pending|success|failed|canceled|skipped|created|manual|waiting_for_resource|preparing|scheduled}") + ci_listCmd.Flags().StringP("orderBy", "o", "", "Order pipelines by this field. Options: id, status, ref, updated_at, user_id.") + ci_listCmd.Flags().StringP("output", "F", "", "Format output. Options: text, json.") + ci_listCmd.Flags().StringP("page", "p", "", "Page number.") + ci_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + ci_listCmd.Flags().String("sort", "", "Sort pipelines. Options: asc, desc.") + ci_listCmd.Flags().StringP("status", "s", "", "Get pipeline with this status. Options: running, pending, success, failed, canceled, skipped, created, manual, waiting_for_resource, preparing, scheduled}") ciCmd.AddCommand(ci_listCmd) carapace.Gen(ci_listCmd).FlagCompletion(carapace.ActionMap{ "orderBy": carapace.ActionValues("id", "status", "ref", "updated_at", "user_id"), + "output": carapace.ActionValues("text", "json"), "sort": carapace.ActionValues("asc", "desc"), "status": carapace.ActionValues("running", "pending", "success", "failed", "canceled", "skipped", "created", "manual", "waiting_for_resource", "preparing", "scheduled"), }) diff --git a/completers/glab_completer/cmd/ci_retry.go b/completers/glab_completer/cmd/ci_retry.go index c0f94e525d..ec3cec414b 100644 --- a/completers/glab_completer/cmd/ci_retry.go +++ b/completers/glab_completer/cmd/ci_retry.go @@ -2,19 +2,27 @@ package cmd import ( "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/glab_completer/cmd/action" "github.com/spf13/cobra" ) var ci_retryCmd = &cobra.Command{ Use: "retry ", - Short: "Retry a CI/CD job", + Short: "Retry a CI/CD job.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(ci_retryCmd).Standalone() + ci_retryCmd.Flags().StringP("branch", "b", "", "The branch to search for the job. Default: current branch.") + ci_retryCmd.Flags().StringP("pipeline-id", "p", "", "The pipeline ID to search for the job.") ciCmd.AddCommand(ci_retryCmd) + carapace.Gen(ci_retryCmd).FlagCompletion(carapace.ActionMap{ + "branch": action.ActionBranches(ci_retryCmd), + "pipeline-id": action.ActionPipelines(ci_retryCmd, ""), + }) + // TODO positional completion } diff --git a/completers/glab_completer/cmd/ci_run.go b/completers/glab_completer/cmd/ci_run.go index 28196803bc..4323a07fe8 100644 --- a/completers/glab_completer/cmd/ci_run.go +++ b/completers/glab_completer/cmd/ci_run.go @@ -10,7 +10,7 @@ import ( var ci_runCmd = &cobra.Command{ Use: "run [flags]", - Short: "Create or run a new CI/CD pipeline", + Short: "Create or run a new CI/CD pipeline.", Aliases: []string{"create"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -18,11 +18,11 @@ var ci_runCmd = &cobra.Command{ func init() { carapace.Gen(ci_runCmd).Standalone() - ci_runCmd.Flags().StringP("branch", "b", "", "Create pipeline on branch/ref ") - ci_runCmd.Flags().StringSlice("variables", []string{}, "Pass variables to pipeline in format :") - ci_runCmd.Flags().StringSlice("variables-env", []string{}, "Pass variables to pipeline in format :") - ci_runCmd.Flags().StringSlice("variables-file", []string{}, "Pass file contents as a file variable to pipeline in format :") - ci_runCmd.Flags().StringP("variables-from", "f", "", "JSON file containing variables for pipeline execution") + ci_runCmd.Flags().StringP("branch", "b", "", "Create pipeline on branch/ref .") + ci_runCmd.Flags().StringSlice("variables", []string{}, "Pass variables to pipeline in format :.") + ci_runCmd.Flags().StringSlice("variables-env", []string{}, "Pass variables to pipeline in format :.") + ci_runCmd.Flags().StringSlice("variables-file", []string{}, "Pass file contents as a file variable to pipeline in format :.") + ci_runCmd.Flags().StringP("variables-from", "f", "", "JSON file containing variables for pipeline execution.") ciCmd.AddCommand(ci_runCmd) carapace.Gen(ci_runCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/ci_runTrig.go b/completers/glab_completer/cmd/ci_runTrig.go new file mode 100644 index 0000000000..992f76ada2 --- /dev/null +++ b/completers/glab_completer/cmd/ci_runTrig.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/glab_completer/cmd/action" + "github.com/spf13/cobra" +) + +var ci_runTrigCmd = &cobra.Command{ + Use: "run-trig [flags]", + Short: "Run a CI/CD pipeline trigger.", + Aliases: []string{"run-trig"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(ci_runTrigCmd).Standalone() + + ci_runTrigCmd.Flags().StringP("branch", "b", "", "Create pipeline on branch or reference .") + ci_runTrigCmd.Flags().StringP("token", "t", "", "Pipeline trigger token. Can be omitted only if the `CI_JOB_TOKEN` environment variable is set.") + ci_runTrigCmd.Flags().StringSlice("variables", []string{}, "Pass variables to pipeline in the format :.") + ciCmd.AddCommand(ci_runTrigCmd) + + carapace.Gen(ci_runTrigCmd).FlagCompletion(carapace.ActionMap{ + "branch": action.ActionBranches(ci_runCmd), + }) +} diff --git a/completers/glab_completer/cmd/ci_status.go b/completers/glab_completer/cmd/ci_status.go index 80d2cb47f2..d057f1a6fd 100644 --- a/completers/glab_completer/cmd/ci_status.go +++ b/completers/glab_completer/cmd/ci_status.go @@ -8,7 +8,7 @@ import ( var ci_statusCmd = &cobra.Command{ Use: "status [flags]", - Short: "View a running CI/CD pipeline on current or other branch specified", + Short: "View a running CI/CD pipeline on current or other branch specified.", Aliases: []string{"stats"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,9 +16,9 @@ var ci_statusCmd = &cobra.Command{ func init() { carapace.Gen(ci_statusCmd).Standalone() - ci_statusCmd.Flags().StringP("branch", "b", "", "Check pipeline status for a branch. (Default is current branch)") - ci_statusCmd.Flags().BoolP("compact", "c", false, "Show status in compact format") - ci_statusCmd.Flags().BoolP("live", "l", false, "Show status in real-time till pipeline ends") + ci_statusCmd.Flags().StringP("branch", "b", "", "Check pipeline status for a branch. Default: current branch.") + ci_statusCmd.Flags().BoolP("compact", "c", false, "Show status in compact format.") + ci_statusCmd.Flags().BoolP("live", "l", false, "Show status in real time until the pipeline ends.") ciCmd.AddCommand(ci_statusCmd) carapace.Gen(ci_statusCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/ci_trace.go b/completers/glab_completer/cmd/ci_trace.go index 02b5b3e0c6..b7494dde4b 100644 --- a/completers/glab_completer/cmd/ci_trace.go +++ b/completers/glab_completer/cmd/ci_trace.go @@ -8,14 +8,15 @@ import ( var ci_traceCmd = &cobra.Command{ Use: "trace [] [flags]", - Short: "Trace a CI/CD job log in real time", + Short: "Trace a CI/CD job log in real time.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(ci_traceCmd).Standalone() - ci_traceCmd.Flags().StringP("branch", "b", "", "Check pipeline status for a branch. (Default is the current branch)") + ci_traceCmd.Flags().StringP("branch", "b", "", "The branch to search for the job. Default: current branch.") + ci_traceCmd.Flags().StringP("pipeline-id", "p", "", "The pipeline ID to search for the job.") ciCmd.AddCommand(ci_traceCmd) carapace.Gen(ci_statusCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/ci_trigger.go b/completers/glab_completer/cmd/ci_trigger.go new file mode 100644 index 0000000000..58da86eaa3 --- /dev/null +++ b/completers/glab_completer/cmd/ci_trigger.go @@ -0,0 +1,26 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/glab_completer/cmd/action" + "github.com/spf13/cobra" +) + +var ci_triggerCmd = &cobra.Command{ + Use: "trigger ", + Short: "Trigger a manual CI/CD job.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(ci_triggerCmd).Standalone() + + ci_triggerCmd.Flags().StringP("branch", "b", "", "The branch to search for the job. Default: current branch.") + ci_triggerCmd.Flags().StringP("pipeline-id", "p", "", "The pipeline ID to search for the job.") + ciCmd.AddCommand(ci_triggerCmd) + + carapace.Gen(ci_triggerCmd).FlagCompletion(carapace.ActionMap{ + "branch": action.ActionBranches(ci_triggerCmd), + "pipeline-id": action.ActionPipelines(ci_triggerCmd, ""), + }) +} diff --git a/completers/glab_completer/cmd/ci_view.go b/completers/glab_completer/cmd/ci_view.go index e5f1a031d7..4f874242bf 100644 --- a/completers/glab_completer/cmd/ci_view.go +++ b/completers/glab_completer/cmd/ci_view.go @@ -8,14 +8,15 @@ import ( var ci_viewCmd = &cobra.Command{ Use: "view [branch/tag]", - Short: "View, run, trace/logs, and cancel CI/CD jobs current pipeline", + Short: "View, run, trace, log, and cancel CI/CD job's current pipeline.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(ci_viewCmd).Standalone() - ci_viewCmd.Flags().StringP("branch", "b", "", "Check pipeline status for a branch/tag. (Default is the current branch)") + ci_viewCmd.Flags().StringP("branch", "b", "", "Check pipeline status for a branch or tag. Defaults to the current branch.") + ci_viewCmd.Flags().BoolP("web", "w", false, "Open pipeline in a browser. Uses default browser, or browser specified in BROWSER variable.") ciCmd.AddCommand(ci_viewCmd) carapace.Gen(ci_viewCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/cluster.go b/completers/glab_completer/cmd/cluster.go new file mode 100644 index 0000000000..46c7735caa --- /dev/null +++ b/completers/glab_completer/cmd/cluster.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/glab_completer/cmd/action" + "github.com/spf13/cobra" +) + +var clusterCmd = &cobra.Command{ + Use: "cluster [flags]", + Short: "Manage GitLab Agents for Kubernetes and their clusters.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(clusterCmd).Standalone() + + clusterCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") + rootCmd.AddCommand(clusterCmd) + + carapace.Gen(clusterCmd).FlagCompletion(carapace.ActionMap{ + "repo": action.ActionRepo(clusterCmd), + }) +} diff --git a/completers/glab_completer/cmd/cluster_agent.go b/completers/glab_completer/cmd/cluster_agent.go new file mode 100644 index 0000000000..87e349f925 --- /dev/null +++ b/completers/glab_completer/cmd/cluster_agent.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/glab_completer/cmd/action" + "github.com/spf13/cobra" +) + +var cluster_agentCmd = &cobra.Command{ + Use: "agent [flags]", + Short: "Manage GitLab Agents for Kubernetes.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cluster_agentCmd).Standalone() + + cluster_agentCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") + clusterCmd.AddCommand(cluster_agentCmd) + + carapace.Gen(cluster_agentCmd).FlagCompletion(carapace.ActionMap{ + "repo": action.ActionRepo(cluster_agentCmd), + }) +} diff --git a/completers/glab_completer/cmd/cluster_agent_bootstrap.go b/completers/glab_completer/cmd/cluster_agent_bootstrap.go new file mode 100644 index 0000000000..8484fc242b --- /dev/null +++ b/completers/glab_completer/cmd/cluster_agent_bootstrap.go @@ -0,0 +1,35 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var cluster_agent_bootstrapCmd = &cobra.Command{ + Use: "bootstrap agent-name [flags]", + Short: "Bootstrap a GitLab Agent for Kubernetes in a project.", + Aliases: []string{"bs"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cluster_agent_bootstrapCmd).Standalone() + + cluster_agent_bootstrapCmd.Flags().String("flux-source-name", "", "Flux source name.") + cluster_agent_bootstrapCmd.Flags().String("flux-source-namespace", "", "Flux source namespace.") + cluster_agent_bootstrapCmd.Flags().String("flux-source-type", "", "Source type of the flux-system, e.g. git, oci, helm, ...") + cluster_agent_bootstrapCmd.Flags().String("gitlab-agent-token-secret-name", "", "Name of the Secret where the token for the GitLab Agent is stored. The helm-release-target-namespace is implied for the namespace of the Secret.") + cluster_agent_bootstrapCmd.Flags().String("helm-release-filepath", "", "Filepath within the GitLab Agent project to commit the Flux HelmRelease to.") + cluster_agent_bootstrapCmd.Flags().String("helm-release-name", "", "Name of the Flux HelmRelease manifest.") + cluster_agent_bootstrapCmd.Flags().String("helm-release-namespace", "", "Namespace of the Flux HelmRelease manifest.") + cluster_agent_bootstrapCmd.Flags().String("helm-release-target-namespace", "", "Namespace of the GitLab Agent deployment.") + cluster_agent_bootstrapCmd.Flags().String("helm-repository-filepath", "", "Filepath within the GitLab Agent project to commit the Flux HelmRepository to.") + cluster_agent_bootstrapCmd.Flags().String("helm-repository-name", "", "Name of the Flux HelmRepository manifest.") + cluster_agent_bootstrapCmd.Flags().String("helm-repository-namespace", "", "Namespace of the Flux HelmRepository manifest.") + cluster_agent_bootstrapCmd.Flags().StringP("manifest-branch", "b", "", "Branch to commit the Flux Manifests to. (default to the project default branch)") + cluster_agent_bootstrapCmd.Flags().StringP("manifest-path", "p", "", "Location of directory in Git repository for storing the GitLab Agent for Kubernetes Helm resources.") + cluster_agent_bootstrapCmd.Flags().Bool("no-reconcile", false, "Do not trigger Flux reconciliation for GitLab Agent for Kubernetes Flux resource.") + cluster_agentCmd.AddCommand(cluster_agent_bootstrapCmd) + + // TODO flag completion +} diff --git a/completers/glab_completer/cmd/cluster_agent_check_manifest_usage.go b/completers/glab_completer/cmd/cluster_agent_check_manifest_usage.go new file mode 100644 index 0000000000..6e06319c56 --- /dev/null +++ b/completers/glab_completer/cmd/cluster_agent_check_manifest_usage.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var cluster_agent_check_manifest_usageCmd = &cobra.Command{ + Use: "check_manifest_usage [flags]", + Short: "Check agent configuration files for built-in GitOps manifests usage. (EXPERIMENTAL.)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cluster_agent_check_manifest_usageCmd).Standalone() + + cluster_agent_check_manifest_usageCmd.Flags().StringP("agent-page", "a", "", "Page number for projects.") + cluster_agent_check_manifest_usageCmd.Flags().StringP("agent-per-page", "A", "", "Number of projects to list per page.") + cluster_agent_check_manifest_usageCmd.Flags().StringP("group", "g", "", "Group ID to check.") + cluster_agent_check_manifest_usageCmd.Flags().StringP("page", "p", "", "Page number for projects.") + cluster_agent_check_manifest_usageCmd.Flags().StringP("per-page", "P", "", "Number of projects to list per page.") + cluster_agent_check_manifest_usageCmd.Flags().BoolP("recursive", "r", false, "Recursively check subgroups.") + cluster_agent_check_manifest_usageCmd.MarkFlagRequired("group") + cluster_agentCmd.AddCommand(cluster_agent_check_manifest_usageCmd) + + // TODO flag completion +} diff --git a/completers/glab_completer/cmd/cluster_agent_getToken.go b/completers/glab_completer/cmd/cluster_agent_getToken.go new file mode 100644 index 0000000000..80994c0a97 --- /dev/null +++ b/completers/glab_completer/cmd/cluster_agent_getToken.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var cluster_agent_getTokenCmd = &cobra.Command{ + Use: "get-token [flags]", + Short: "Create and return a k8s_proxy-scoped personal access token to authenticate with a GitLab Agents for Kubernetes.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cluster_agent_getTokenCmd).Standalone() + + cluster_agent_getTokenCmd.Flags().StringP("agent", "a", "", "The numerical Agent ID to connect to.") + cluster_agent_getTokenCmd.MarkFlagRequired("agent") + cluster_agentCmd.AddCommand(cluster_agent_getTokenCmd) + + // TODO flag completion +} diff --git a/completers/glab_completer/cmd/cluster_agent_list.go b/completers/glab_completer/cmd/cluster_agent_list.go new file mode 100644 index 0000000000..ea8fce33cb --- /dev/null +++ b/completers/glab_completer/cmd/cluster_agent_list.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var cluster_agent_listCmd = &cobra.Command{ + Use: "list [flags]", + Short: "List GitLab Agents for Kubernetes in a project.", + Aliases: []string{"ls"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cluster_agent_listCmd).Standalone() + + cluster_agent_listCmd.Flags().StringP("page", "p", "", "Page number.") + cluster_agent_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + cluster_agentCmd.AddCommand(cluster_agent_listCmd) +} diff --git a/completers/glab_completer/cmd/cluster_agent_updateKubeconfig.go b/completers/glab_completer/cmd/cluster_agent_updateKubeconfig.go new file mode 100644 index 0000000000..dd3d45ba31 --- /dev/null +++ b/completers/glab_completer/cmd/cluster_agent_updateKubeconfig.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var cluster_agent_updateKubeconfigCmd = &cobra.Command{ + Use: "update-kubeconfig [flags]", + Short: "Update selected kubeconfig.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cluster_agent_updateKubeconfigCmd).Standalone() + + cluster_agent_updateKubeconfigCmd.Flags().StringP("agent", "a", "", "The numeric agent ID to create the kubeconfig entry for.") + cluster_agent_updateKubeconfigCmd.PersistentFlags().String("kubeconfig", "", "Use a particular kubeconfig file.") + cluster_agent_updateKubeconfigCmd.PersistentFlags().BoolP("use-context", "u", false, "Use as default context.") + cluster_agent_updateKubeconfigCmd.MarkFlagRequired("agent") + cluster_agentCmd.AddCommand(cluster_agent_updateKubeconfigCmd) + + // TODO flag completion +} diff --git a/completers/glab_completer/cmd/completion.go b/completers/glab_completer/cmd/completion.go index f641197490..f21a17765a 100644 --- a/completers/glab_completer/cmd/completion.go +++ b/completers/glab_completer/cmd/completion.go @@ -7,15 +7,15 @@ import ( var completionCmd = &cobra.Command{ Use: "completion", - Short: "Generate shell completion scripts", + Short: "Generate shell completion scripts.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(completionCmd).Standalone() - completionCmd.Flags().Bool("no-desc", false, "Do not include shell completion description") - completionCmd.Flags().StringP("shell", "s", "", "Shell type: {bash|zsh|fish|powershell}") + completionCmd.Flags().Bool("no-desc", false, "Do not include shell completion description.") + completionCmd.Flags().StringP("shell", "s", "", "Shell type: bash, zsh, fish, powershell.") rootCmd.AddCommand(completionCmd) carapace.Gen(completionCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/config.go b/completers/glab_completer/cmd/config.go index fdea5bc066..9636c88c81 100644 --- a/completers/glab_completer/cmd/config.go +++ b/completers/glab_completer/cmd/config.go @@ -7,7 +7,7 @@ import ( var configCmd = &cobra.Command{ Use: "config [flags]", - Short: "Set and get glab settings", + Short: "Set and get glab settings.", Aliases: []string{"conf"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -15,6 +15,6 @@ var configCmd = &cobra.Command{ func init() { carapace.Gen(configCmd).Standalone() - configCmd.Flags().BoolP("global", "g", false, "Use global config file") + configCmd.Flags().BoolP("global", "g", false, "Use global config file.") rootCmd.AddCommand(configCmd) } diff --git a/completers/glab_completer/cmd/config_get.go b/completers/glab_completer/cmd/config_get.go index bcd0bdaf2e..7752e02a57 100644 --- a/completers/glab_completer/cmd/config_get.go +++ b/completers/glab_completer/cmd/config_get.go @@ -15,8 +15,8 @@ var config_getCmd = &cobra.Command{ func init() { carapace.Gen(config_getCmd).Standalone() - config_getCmd.Flags().BoolP("global", "g", false, "Read from global config file (~/.config/glab-cli/config.yml). [Default: looks through Environment variables → Local → Global]") - config_getCmd.Flags().StringP("host", "h", "", "Get per-host setting") + config_getCmd.Flags().BoolP("global", "g", false, "Read from global config file (~/.config/glab-cli/config.yml). Default: checks 'Environment variables → Local → Global'.") + config_getCmd.Flags().StringP("host", "h", "", "Get per-host setting.") configCmd.AddCommand(config_getCmd) carapace.Gen(config_getCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/config_set.go b/completers/glab_completer/cmd/config_set.go index 74393984dd..528aaa00ae 100644 --- a/completers/glab_completer/cmd/config_set.go +++ b/completers/glab_completer/cmd/config_set.go @@ -8,15 +8,15 @@ import ( var config_setCmd = &cobra.Command{ Use: "set ", - Short: "Updates configuration with the value of a given key", + Short: "Updates configuration with the value of a given key.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(config_setCmd).Standalone() - config_setCmd.Flags().BoolP("global", "g", false, "Write to global ~/.config/glab-cli/config.yml file rather than the repository .git/glab-cli/config.yml file") - config_setCmd.Flags().StringP("host", "h", "", "Set per-host setting") + config_setCmd.Flags().BoolP("global", "g", false, "Write to global '~/.config/glab-cli/config.yml' file rather than the repository's '.git/glab-cli/config.yml' file.") + config_setCmd.Flags().StringP("host", "h", "", "Set per-host setting.") configCmd.AddCommand(config_setCmd) carapace.Gen(config_setCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/duo.go b/completers/glab_completer/cmd/duo.go new file mode 100644 index 0000000000..a6329d6abd --- /dev/null +++ b/completers/glab_completer/cmd/duo.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var duoCmd = &cobra.Command{ + Use: "duo prompt", + Short: "Generate terminal commands from natural language.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(duoCmd).Standalone() + + rootCmd.AddCommand(duoCmd) +} diff --git a/completers/glab_completer/cmd/duo_ask.go b/completers/glab_completer/cmd/duo_ask.go new file mode 100644 index 0000000000..11b9d49ed7 --- /dev/null +++ b/completers/glab_completer/cmd/duo_ask.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var duo_askCmd = &cobra.Command{ + Use: "ask ", + Short: "Generate Git commands from natural language.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(duo_askCmd).Standalone() + + duo_askCmd.Flags().Bool("git", false, "Ask a question about Git.") + duoCmd.AddCommand(duo_askCmd) +} diff --git a/completers/glab_completer/cmd/incident.go b/completers/glab_completer/cmd/incident.go index 9d654affad..346ef0cde8 100644 --- a/completers/glab_completer/cmd/incident.go +++ b/completers/glab_completer/cmd/incident.go @@ -8,14 +8,14 @@ import ( var incidentCmd = &cobra.Command{ Use: "incident [command] [flags]", - Short: "Work with GitLab incidents", + Short: "Work with GitLab incidents.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(incidentCmd).Standalone() - incidentCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + incidentCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") rootCmd.AddCommand(incidentCmd) carapace.Gen(incidentCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/incident_close.go b/completers/glab_completer/cmd/incident_close.go index ab4bc660cf..2b14e43bca 100644 --- a/completers/glab_completer/cmd/incident_close.go +++ b/completers/glab_completer/cmd/incident_close.go @@ -7,7 +7,7 @@ import ( var incident_closeCmd = &cobra.Command{ Use: "close [ | ] [flags]", - Short: "Close an incident", + Short: "Close an incident.", Aliases: []string{"resolve"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/incident_list.go b/completers/glab_completer/cmd/incident_list.go index db19c9ef75..d90796138b 100644 --- a/completers/glab_completer/cmd/incident_list.go +++ b/completers/glab_completer/cmd/incident_list.go @@ -8,7 +8,7 @@ import ( var incident_listCmd = &cobra.Command{ Use: "list [flags]", - Short: "List project incidents", + Short: "List project incidents.", Aliases: []string{"ls"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,25 +16,26 @@ var incident_listCmd = &cobra.Command{ func init() { carapace.Gen(incident_listCmd).Standalone() - incident_listCmd.Flags().BoolP("all", "A", false, "Get all incidents") - incident_listCmd.Flags().StringP("assignee", "a", "", "Filter incident by assignee ") - incident_listCmd.Flags().String("author", "", "Filter incident by author ") - incident_listCmd.Flags().BoolP("closed", "c", false, "Get only closed incidents") - incident_listCmd.Flags().BoolP("confidential", "C", false, "Filter by confidential incidents") - incident_listCmd.PersistentFlags().StringP("group", "g", "", "Select a group/subgroup. This option is ignored if a repo argument is set.") - incident_listCmd.Flags().String("in", "", "search in {title|description}") - incident_listCmd.Flags().StringSliceP("label", "l", []string{}, "Filter incident by label ") - incident_listCmd.Flags().StringP("milestone", "m", "", "Filter incident by milestone ") - incident_listCmd.Flags().BoolP("mine", "M", false, "Filter only incidents assigned to me") - incident_listCmd.Flags().StringSlice("not-assignee", []string{}, "Filter incident by not being assigneed to ") - incident_listCmd.Flags().StringSlice("not-author", []string{}, "Filter by not being by author(s) ") - incident_listCmd.Flags().StringSlice("not-label", []string{}, "Filter incident by lack of label ") - incident_listCmd.Flags().BoolP("opened", "o", false, "Get only open incidents") - incident_listCmd.Flags().StringP("output-format", "F", "", "One of 'details', 'ids', or 'urls'") - incident_listCmd.Flags().StringP("page", "p", "", "Page number") + incident_listCmd.Flags().BoolP("all", "A", false, "Get all incidents.") + incident_listCmd.Flags().StringP("assignee", "a", "", "Filter incident by assignee .") + incident_listCmd.Flags().String("author", "", "Filter incident by author .") + incident_listCmd.Flags().BoolP("closed", "c", false, "Get only closed incidents.") + incident_listCmd.Flags().BoolP("confidential", "C", false, "Filter by confidential incidents.") + incident_listCmd.PersistentFlags().StringP("group", "g", "", "Select a group or subgroup. Ignored if a repo argument is set.") + incident_listCmd.Flags().String("in", "", "search in: title, description.") + incident_listCmd.Flags().StringSliceP("label", "l", []string{}, "Filter incident by label .") + incident_listCmd.Flags().StringP("milestone", "m", "", "Filter incident by milestone .") + incident_listCmd.Flags().BoolP("mine", "M", false, "Filter only incidents assigned to me.") + incident_listCmd.Flags().StringSlice("not-assignee", []string{}, "Filter incident by not being assigneed to .") + incident_listCmd.Flags().StringSlice("not-author", []string{}, "Filter by not being by author(s) .") + incident_listCmd.Flags().StringSlice("not-label", []string{}, "Filter incident by lack of label .") + incident_listCmd.Flags().BoolP("opened", "o", false, "Get only open incidents.") + incident_listCmd.Flags().StringP("output", "O", "", "Options: 'text' or 'json'.") + incident_listCmd.Flags().StringP("output-format", "F", "", "Options: 'details', 'ids', 'urls'.") + incident_listCmd.Flags().StringP("page", "p", "", "Page number.") incident_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") - incident_listCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") - incident_listCmd.Flags().String("search", "", "Search in the fields defined by --in") + incident_listCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") + incident_listCmd.Flags().String("search", "", "Search in the fields defined by '--in'.") incident_listCmd.Flag("mine").Hidden = true incident_listCmd.Flag("opened").Hidden = true incidentCmd.AddCommand(incident_listCmd) diff --git a/completers/glab_completer/cmd/incident_note.go b/completers/glab_completer/cmd/incident_note.go index 64d983fdf5..e894f0f9d3 100644 --- a/completers/glab_completer/cmd/incident_note.go +++ b/completers/glab_completer/cmd/incident_note.go @@ -7,7 +7,7 @@ import ( var incident_noteCmd = &cobra.Command{ Use: "note ", - Short: "Comment on an incident in GitLab", + Short: "Comment on an incident in GitLab.", Aliases: []string{"comment"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -15,7 +15,7 @@ var incident_noteCmd = &cobra.Command{ func init() { carapace.Gen(incident_noteCmd).Standalone() - incident_noteCmd.Flags().StringP("message", "m", "", "Comment/Note message") + incident_noteCmd.Flags().StringP("message", "m", "", "Message text.") incidentCmd.AddCommand(incident_noteCmd) // TODO positional completion diff --git a/completers/glab_completer/cmd/incident_reopen.go b/completers/glab_completer/cmd/incident_reopen.go index 528a0c65d5..7cfd55d450 100644 --- a/completers/glab_completer/cmd/incident_reopen.go +++ b/completers/glab_completer/cmd/incident_reopen.go @@ -7,7 +7,7 @@ import ( var incident_reopenCmd = &cobra.Command{ Use: "reopen [ | ] [flags]", - Short: "Reopen a resolved incident", + Short: "Reopen a resolved incident.", Aliases: []string{"open"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/incident_subscribe.go b/completers/glab_completer/cmd/incident_subscribe.go index 6ebd43e1e7..44d8d924c4 100644 --- a/completers/glab_completer/cmd/incident_subscribe.go +++ b/completers/glab_completer/cmd/incident_subscribe.go @@ -7,7 +7,7 @@ import ( var incident_subscribeCmd = &cobra.Command{ Use: "subscribe ", - Short: "Subscribe to an incident", + Short: "Subscribe to an incident.", Aliases: []string{"sub"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/incident_unsubscribe.go b/completers/glab_completer/cmd/incident_unsubscribe.go index 564991581e..6811d6b23b 100644 --- a/completers/glab_completer/cmd/incident_unsubscribe.go +++ b/completers/glab_completer/cmd/incident_unsubscribe.go @@ -7,7 +7,7 @@ import ( var incident_unsubscribeCmd = &cobra.Command{ Use: "unsubscribe ", - Short: "Unsubscribe from an incident", + Short: "Unsubscribe from an incident.", Aliases: []string{"unsub"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/incident_view.go b/completers/glab_completer/cmd/incident_view.go index c5d25ebed1..e3bb53f416 100644 --- a/completers/glab_completer/cmd/incident_view.go +++ b/completers/glab_completer/cmd/incident_view.go @@ -15,11 +15,12 @@ var incident_viewCmd = &cobra.Command{ func init() { carapace.Gen(incident_viewCmd).Standalone() - incident_viewCmd.Flags().BoolP("comments", "c", false, "Show incident comments and activities") - incident_viewCmd.Flags().StringP("page", "p", "", "Page number") - incident_viewCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page") - incident_viewCmd.Flags().BoolP("system-logs", "s", false, "Show system activities / logs") - incident_viewCmd.Flags().BoolP("web", "w", false, "Open incident in a browser. Uses default browser or browser specified in BROWSER variable") + incident_viewCmd.Flags().BoolP("comments", "c", false, "Show incident comments and activities.") + incident_viewCmd.Flags().StringP("output", "F", "", "Format output as: text, json.") + incident_viewCmd.Flags().StringP("page", "p", "", "Page number.") + incident_viewCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + incident_viewCmd.Flags().BoolP("system-logs", "s", false, "Show system activities and logs.") + incident_viewCmd.Flags().BoolP("web", "w", false, "Open incident in a browser. Uses the default browser, or the browser specified in the $BROWSER variable.") incidentCmd.AddCommand(incident_viewCmd) // TODO positional completion diff --git a/completers/glab_completer/cmd/issue.go b/completers/glab_completer/cmd/issue.go index d05e9b04b6..2fd2943ec4 100644 --- a/completers/glab_completer/cmd/issue.go +++ b/completers/glab_completer/cmd/issue.go @@ -8,14 +8,14 @@ import ( var issueCmd = &cobra.Command{ Use: "issue [command] [flags]", - Short: "Work with GitLab issues", + Short: "Work with GitLab issues.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(issueCmd).Standalone() - issueCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + issueCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") rootCmd.AddCommand(issueCmd) carapace.Gen(issueCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/issue_board_view.go b/completers/glab_completer/cmd/issue_board_view.go index 1baf216c41..260d4ed767 100644 --- a/completers/glab_completer/cmd/issue_board_view.go +++ b/completers/glab_completer/cmd/issue_board_view.go @@ -15,9 +15,9 @@ var issue_board_viewCmd = &cobra.Command{ func init() { carapace.Gen(issue_board_viewCmd).Standalone() - issue_board_viewCmd.Flags().StringP("assignee", "a", "", "Filter board issues by assignee username") - issue_board_viewCmd.Flags().StringSliceP("labels", "l", []string{}, "Filter board issues by labels (comma separated)") - issue_board_viewCmd.Flags().StringP("milestone", "m", "", "Filter board issues by milestone") + issue_board_viewCmd.Flags().StringP("assignee", "a", "", "Filter board issues by assignee username.") + issue_board_viewCmd.Flags().StringSliceP("labels", "l", []string{}, "Filter board issues by labels, comma separated.") + issue_board_viewCmd.Flags().StringP("milestone", "m", "", "Filter board issues by milestone.") issue_boardCmd.AddCommand(issue_board_viewCmd) carapace.Gen(issue_board_viewCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/issue_close.go b/completers/glab_completer/cmd/issue_close.go index b0c30a5c21..f6ff417238 100644 --- a/completers/glab_completer/cmd/issue_close.go +++ b/completers/glab_completer/cmd/issue_close.go @@ -8,7 +8,7 @@ import ( var issue_closeCmd = &cobra.Command{ Use: "close [ | ] [flags]", - Short: "Close an issue", + Short: "Close an issue.", Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/issue_create.go b/completers/glab_completer/cmd/issue_create.go index 63f9fc4532..251e8c6f32 100644 --- a/completers/glab_completer/cmd/issue_create.go +++ b/completers/glab_completer/cmd/issue_create.go @@ -8,7 +8,7 @@ import ( var issue_createCmd = &cobra.Command{ Use: "create [flags]", - Short: "Create an issue", + Short: "Create an issue.", Aliases: []string{"new"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,22 +16,24 @@ var issue_createCmd = &cobra.Command{ func init() { carapace.Gen(issue_createCmd).Standalone() - issue_createCmd.Flags().StringSliceP("assignee", "a", []string{}, "Assign issue to people by their `usernames`") - issue_createCmd.Flags().BoolP("confidential", "c", false, "Set an issue to be confidential. (default false)") - issue_createCmd.Flags().StringP("description", "d", "", "Supply a description for issue") - issue_createCmd.Flags().StringSliceP("label", "l", []string{}, "Add label by name. Multiple labels should be comma separated") + issue_createCmd.Flags().StringSliceP("assignee", "a", []string{}, "Assign issue to people by their `usernames`.") + issue_createCmd.Flags().BoolP("confidential", "c", false, "Set an issue to be confidential. Default: false.") + issue_createCmd.Flags().StringP("description", "d", "", "Issue description.") + issue_createCmd.Flags().String("due-date", "", "A date in 'YYYY-MM-DD' format.") + issue_createCmd.Flags().String("epic", "", "ID of the epic to add the issue to.") + issue_createCmd.Flags().StringSliceP("label", "l", []string{}, "Add label by name. Multiple labels should be comma-separated.") issue_createCmd.Flags().String("link-type", "", "Type for the issue link") - issue_createCmd.Flags().StringSlice("linked-issues", []string{}, "The IIDs of issues that this issue links to") - issue_createCmd.Flags().String("linked-mr", "", "The IID of a merge request in which to resolve all issues") - issue_createCmd.Flags().StringP("milestone", "m", "", "The global ID or title of a milestone to assign") - issue_createCmd.Flags().Bool("no-editor", false, "Don't open editor to enter description. If set to true, uses prompt. (default false)") - issue_createCmd.Flags().Bool("recover", false, "Save the options to a file if the issue fails to be created. If the file exists, the options will be loaded from the recovery file (EXPERIMENTAL)") - issue_createCmd.Flags().StringP("time-estimate", "e", "", "Set time estimate for the issue") - issue_createCmd.Flags().StringP("time-spent", "s", "", "Set time spent for the issue") - issue_createCmd.Flags().StringP("title", "t", "", "Supply a title for issue") - issue_createCmd.Flags().Bool("web", false, "continue issue creation with web interface") - issue_createCmd.Flags().StringP("weight", "w", "", "The weight of the issue. Valid values are greater than or equal to 0.") - issue_createCmd.Flags().BoolP("yes", "y", false, "Don't prompt for confirmation to submit the issue") + issue_createCmd.Flags().StringSlice("linked-issues", []string{}, "The IIDs of issues that this issue links to.") + issue_createCmd.Flags().String("linked-mr", "", "The IID of a merge request in which to resolve all issues.") + issue_createCmd.Flags().StringP("milestone", "m", "", "The global ID or title of a milestone to assign.") + issue_createCmd.Flags().Bool("no-editor", false, "Don't open editor to enter a description. If set to true, uses prompt. Default: false.") + issue_createCmd.Flags().Bool("recover", false, "Save the options to a file if the issue fails to be created. If the file exists, the options will be loaded from the recovery file. (EXPERIMENTAL.)") + issue_createCmd.Flags().StringP("time-estimate", "e", "", "Set time estimate for the issue.") + issue_createCmd.Flags().StringP("time-spent", "s", "", "Set time spent for the issue.") + issue_createCmd.Flags().StringP("title", "t", "", "Issue title.") + issue_createCmd.Flags().Bool("web", false, "Continue issue creation with web interface.") + issue_createCmd.Flags().StringP("weight", "w", "", "Issue weight. Valid values are greater than or equal to 0.") + issue_createCmd.Flags().BoolP("yes", "y", false, "Don't prompt for confirmation to submit the issue.") issueCmd.AddCommand(issue_createCmd) carapace.Gen(issue_createCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/issue_delete.go b/completers/glab_completer/cmd/issue_delete.go index 4f6719fcc4..888acbd791 100644 --- a/completers/glab_completer/cmd/issue_delete.go +++ b/completers/glab_completer/cmd/issue_delete.go @@ -8,7 +8,7 @@ import ( var issue_deleteCmd = &cobra.Command{ Use: "delete ", - Short: "Delete an issue", + Short: "Delete an issue.", Aliases: []string{"del"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/issue_list.go b/completers/glab_completer/cmd/issue_list.go index 2ae5ca9ac3..b9822690c4 100644 --- a/completers/glab_completer/cmd/issue_list.go +++ b/completers/glab_completer/cmd/issue_list.go @@ -8,7 +8,7 @@ import ( var issue_listCmd = &cobra.Command{ Use: "list [flags]", - Short: "List project issues", + Short: "List project issues.", Aliases: []string{"ls"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,26 +16,27 @@ var issue_listCmd = &cobra.Command{ func init() { carapace.Gen(issue_listCmd).Standalone() - issue_listCmd.Flags().BoolP("all", "A", false, "Get all issues") - issue_listCmd.Flags().StringP("assignee", "a", "", "Filter issue by assignee ") - issue_listCmd.Flags().String("author", "", "Filter issue by author ") - issue_listCmd.Flags().BoolP("closed", "c", false, "Get only closed issues") - issue_listCmd.Flags().BoolP("confidential", "C", false, "Filter by confidential issues") - issue_listCmd.PersistentFlags().StringP("group", "g", "", "Select a group/subgroup. This option is ignored if a repo argument is set.") - issue_listCmd.Flags().String("in", "", "search in {title|description}") - issue_listCmd.Flags().StringP("issue-type", "t", "", "Filter issue by its type {issue|incident|test_case}") - issue_listCmd.Flags().StringSliceP("label", "l", []string{}, "Filter issue by label ") - issue_listCmd.Flags().StringP("milestone", "m", "", "Filter issue by milestone ") - issue_listCmd.Flags().BoolP("mine", "M", false, "Filter only issues assigned to me") - issue_listCmd.Flags().StringSlice("not-assignee", []string{}, "Filter issue by not being assigneed to ") - issue_listCmd.Flags().StringSlice("not-author", []string{}, "Filter by not being by author(s) ") - issue_listCmd.Flags().StringSlice("not-label", []string{}, "Filter issue by lack of label ") - issue_listCmd.Flags().BoolP("opened", "o", false, "Get only open issues") - issue_listCmd.Flags().StringP("output-format", "F", "", "One of 'details', 'ids', or 'urls'") - issue_listCmd.Flags().StringP("page", "p", "", "Page number") + issue_listCmd.Flags().BoolP("all", "A", false, "Get all issues.") + issue_listCmd.Flags().StringP("assignee", "a", "", "Filter issue by assignee .") + issue_listCmd.Flags().String("author", "", "Filter issue by author .") + issue_listCmd.Flags().BoolP("closed", "c", false, "Get only closed issues.") + issue_listCmd.Flags().BoolP("confidential", "C", false, "Filter by confidential issues.") + issue_listCmd.PersistentFlags().StringP("group", "g", "", "Select a group or subgroup. Ignored if a repo argument is set.") + issue_listCmd.Flags().String("in", "", "search in: title, description.") + issue_listCmd.Flags().StringP("issue-type", "t", "", "Filter issue by its type. Options: issue, incident, test_case.") + issue_listCmd.Flags().StringSliceP("label", "l", []string{}, "Filter issue by label .") + issue_listCmd.Flags().StringP("milestone", "m", "", "Filter issue by milestone .") + issue_listCmd.Flags().BoolP("mine", "M", false, "Filter only issues assigned to me.") + issue_listCmd.Flags().StringSlice("not-assignee", []string{}, "Filter issue by not being assigneed to .") + issue_listCmd.Flags().StringSlice("not-author", []string{}, "Filter by not being by author(s) .") + issue_listCmd.Flags().StringSlice("not-label", []string{}, "Filter issue by lack of label .") + issue_listCmd.Flags().BoolP("opened", "o", false, "Get only open issues.") + issue_listCmd.Flags().StringP("output", "O", "", "Options: 'text' or 'json'.") + issue_listCmd.Flags().StringP("output-format", "F", "", "Options: 'details', 'ids', 'urls'.") + issue_listCmd.Flags().StringP("page", "p", "", "Page number.") issue_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") - issue_listCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") - issue_listCmd.Flags().String("search", "", "Search in the fields defined by --in") + issue_listCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") + issue_listCmd.Flags().String("search", "", "Search in the fields defined by '--in'.") issue_listCmd.Flag("mine").Hidden = true issue_listCmd.Flag("opened").Hidden = true issueCmd.AddCommand(issue_listCmd) diff --git a/completers/glab_completer/cmd/issue_note.go b/completers/glab_completer/cmd/issue_note.go index a083594c97..5332180c0b 100644 --- a/completers/glab_completer/cmd/issue_note.go +++ b/completers/glab_completer/cmd/issue_note.go @@ -8,7 +8,7 @@ import ( var issue_noteCmd = &cobra.Command{ Use: "note ", - Short: "Comment on an issue in GitLab", + Short: "Comment on an issue in GitLab.", Aliases: []string{"comment"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,7 +16,7 @@ var issue_noteCmd = &cobra.Command{ func init() { carapace.Gen(issue_noteCmd).Standalone() - issue_noteCmd.Flags().StringP("message", "m", "", "Comment/Note message") + issue_noteCmd.Flags().StringP("message", "m", "", "Message text.") issueCmd.AddCommand(issue_noteCmd) carapace.Gen(issue_noteCmd).PositionalCompletion( diff --git a/completers/glab_completer/cmd/issue_reopen.go b/completers/glab_completer/cmd/issue_reopen.go index 81c71a6a3c..b0084077a8 100644 --- a/completers/glab_completer/cmd/issue_reopen.go +++ b/completers/glab_completer/cmd/issue_reopen.go @@ -8,7 +8,7 @@ import ( var issue_reopenCmd = &cobra.Command{ Use: "reopen [ | ] [flags]", - Short: "Reopen a closed issue", + Short: "Reopen a closed issue.", Aliases: []string{"open"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/issue_subscribe.go b/completers/glab_completer/cmd/issue_subscribe.go index dcc25b09b0..ab2e84fd44 100644 --- a/completers/glab_completer/cmd/issue_subscribe.go +++ b/completers/glab_completer/cmd/issue_subscribe.go @@ -8,7 +8,7 @@ import ( var issue_subscribeCmd = &cobra.Command{ Use: "subscribe ", - Short: "Subscribe to an issue", + Short: "Subscribe to an issue.", Aliases: []string{"sub"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/issue_unsubscribe.go b/completers/glab_completer/cmd/issue_unsubscribe.go index b6446632cb..613143e9e4 100644 --- a/completers/glab_completer/cmd/issue_unsubscribe.go +++ b/completers/glab_completer/cmd/issue_unsubscribe.go @@ -8,7 +8,7 @@ import ( var issue_unsubscribeCmd = &cobra.Command{ Use: "unsubscribe ", - Short: "Unsubscribe from an issue", + Short: "Unsubscribe from an issue.", Aliases: []string{"unsub"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/issue_update.go b/completers/glab_completer/cmd/issue_update.go index 4440f31fe2..91e59aeaa9 100644 --- a/completers/glab_completer/cmd/issue_update.go +++ b/completers/glab_completer/cmd/issue_update.go @@ -15,17 +15,17 @@ var issue_updateCmd = &cobra.Command{ func init() { carapace.Gen(issue_updateCmd).Standalone() - issue_updateCmd.Flags().StringSliceP("assignee", "a", []string{}, "assign users via username, prefix with '!' or '-' to remove from existing assignees, '+' to add, otherwise replace existing assignees with given users") + issue_updateCmd.Flags().StringSliceP("assignee", "a", []string{}, "Assign users by username. Prefix with '!' or '-' to remove from existing assignees, or '+' to add new. Otherwise, replace existing assignees with these users.") issue_updateCmd.Flags().BoolP("confidential", "c", false, "Make issue confidential") - issue_updateCmd.Flags().StringP("description", "d", "", "Issue description; set to \"-\" to open an editor") - issue_updateCmd.Flags().StringSliceP("label", "l", []string{}, "add labels") - issue_updateCmd.Flags().Bool("lock-discussion", false, "Lock discussion on issue") - issue_updateCmd.Flags().StringP("milestone", "m", "", "title of the milestone to assign, pass \"\" or 0 to unassign") - issue_updateCmd.Flags().BoolP("public", "p", false, "Make issue public") - issue_updateCmd.Flags().StringP("title", "t", "", "Title of issue") - issue_updateCmd.Flags().Bool("unassign", false, "unassign all users") - issue_updateCmd.Flags().StringSliceP("unlabel", "u", []string{}, "remove labels") - issue_updateCmd.Flags().Bool("unlock-discussion", false, "Unlock discussion on issue") + issue_updateCmd.Flags().StringP("description", "d", "", "Issue description. Set to \"-\" to open an editor.") + issue_updateCmd.Flags().StringSliceP("label", "l", []string{}, "Add labels.") + issue_updateCmd.Flags().Bool("lock-discussion", false, "Lock discussion on issue.") + issue_updateCmd.Flags().StringP("milestone", "m", "", "Title of the milestone to assign Set to \"\" or 0 to unassign.") + issue_updateCmd.Flags().BoolP("public", "p", false, "Make issue public.") + issue_updateCmd.Flags().StringP("title", "t", "", "Title of issue.") + issue_updateCmd.Flags().Bool("unassign", false, "Unassign all users.") + issue_updateCmd.Flags().StringSliceP("unlabel", "u", []string{}, "Remove labels.") + issue_updateCmd.Flags().Bool("unlock-discussion", false, "Unlock discussion on issue.") issueCmd.AddCommand(issue_updateCmd) carapace.Gen(issue_updateCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/issue_view.go b/completers/glab_completer/cmd/issue_view.go index bf383a9b53..8e8c9ba663 100644 --- a/completers/glab_completer/cmd/issue_view.go +++ b/completers/glab_completer/cmd/issue_view.go @@ -16,11 +16,12 @@ var issue_viewCmd = &cobra.Command{ func init() { carapace.Gen(issue_viewCmd).Standalone() - issue_viewCmd.Flags().BoolP("comments", "c", false, "Show issue comments and activities") - issue_viewCmd.Flags().StringP("page", "p", "", "Page number") - issue_viewCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page") - issue_viewCmd.Flags().BoolP("system-logs", "s", false, "Show system activities / logs") - issue_viewCmd.Flags().BoolP("web", "w", false, "Open issue in a browser. Uses default browser or browser specified in BROWSER variable") + issue_viewCmd.Flags().BoolP("comments", "c", false, "Show issue comments and activities.") + issue_viewCmd.Flags().StringP("output", "F", "", "Format output as: text, json.") + issue_viewCmd.Flags().StringP("page", "p", "", "Page number.") + issue_viewCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + issue_viewCmd.Flags().BoolP("system-logs", "s", false, "Show system activities and logs.") + issue_viewCmd.Flags().BoolP("web", "w", false, "Open issue in a browser. Uses the default browser, or the browser specified in the $BROWSER variable.") issueCmd.AddCommand(issue_viewCmd) carapace.Gen(issue_viewCmd).PositionalCompletion( diff --git a/completers/glab_completer/cmd/job.go b/completers/glab_completer/cmd/job.go new file mode 100644 index 0000000000..708a397f40 --- /dev/null +++ b/completers/glab_completer/cmd/job.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/glab_completer/cmd/action" + "github.com/spf13/cobra" +) + +var jobCmd = &cobra.Command{ + Use: "job [flags]", + Short: "Work with GitLab CI/CD jobs.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(jobCmd).Standalone() + + jobCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") + rootCmd.AddCommand(jobCmd) + + carapace.Gen(jobCmd).FlagCompletion(carapace.ActionMap{ + "repo": action.ActionRepo(jobCmd), + }) +} diff --git a/completers/glab_completer/cmd/job_artifact.go b/completers/glab_completer/cmd/job_artifact.go new file mode 100644 index 0000000000..ddadbec01b --- /dev/null +++ b/completers/glab_completer/cmd/job_artifact.go @@ -0,0 +1,26 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var job_artifactCmd = &cobra.Command{ + Use: "artifact [flags]", + Short: "Download all artifacts from the last pipeline.", + Aliases: []string{"push"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(job_artifactCmd).Standalone() + + job_artifactCmd.Flags().StringP("path", "p", "", "Path to download the artifact files.") + jobCmd.AddCommand(job_artifactCmd) + + carapace.Gen(job_artifactCmd).FlagCompletion(carapace.ActionMap{ + "path": carapace.ActionDirectories(), + }) + + // TODO positional completion +} diff --git a/completers/glab_completer/cmd/label.go b/completers/glab_completer/cmd/label.go index b1f5ec9cef..c328913fe5 100644 --- a/completers/glab_completer/cmd/label.go +++ b/completers/glab_completer/cmd/label.go @@ -8,14 +8,14 @@ import ( var labelCmd = &cobra.Command{ Use: "label [flags]", - Short: "Manage labels on remote", + Short: "Manage labels on remote.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(labelCmd).Standalone() - labelCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + labelCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") rootCmd.AddCommand(labelCmd) carapace.Gen(labelCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/label_create.go b/completers/glab_completer/cmd/label_create.go index 6da1f4243d..e92685c62c 100644 --- a/completers/glab_completer/cmd/label_create.go +++ b/completers/glab_completer/cmd/label_create.go @@ -9,7 +9,7 @@ import ( var label_createCmd = &cobra.Command{ Use: "create [flags]", - Short: "Create labels for repository/project", + Short: "Create labels for a repository or project.", Aliases: []string{"new"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -17,9 +17,9 @@ var label_createCmd = &cobra.Command{ func init() { carapace.Gen(label_createCmd).Standalone() - label_createCmd.Flags().StringP("color", "c", "", "Color of label in plain or HEX code.") - label_createCmd.Flags().StringP("description", "d", "", "Label description") - label_createCmd.Flags().StringP("name", "n", "", "Name of label") + label_createCmd.Flags().StringP("color", "c", "", "Color of the label, in plain or HEX code.") + label_createCmd.Flags().StringP("description", "d", "", "Label description.") + label_createCmd.Flags().StringP("name", "n", "", "Name of the label.") label_createCmd.MarkFlagRequired("name") labelCmd.AddCommand(label_createCmd) diff --git a/completers/glab_completer/cmd/label_list.go b/completers/glab_completer/cmd/label_list.go index 1332ec94e4..f44b2c0e07 100644 --- a/completers/glab_completer/cmd/label_list.go +++ b/completers/glab_completer/cmd/label_list.go @@ -7,7 +7,7 @@ import ( var label_listCmd = &cobra.Command{ Use: "list [flags]", - Short: "List labels in repository", + Short: "List labels in the repository.", Aliases: []string{"ls"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -15,7 +15,12 @@ var label_listCmd = &cobra.Command{ func init() { carapace.Gen(label_listCmd).Standalone() - label_listCmd.Flags().StringP("page", "p", "", "Page number") - label_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page") + label_listCmd.Flags().StringP("output", "F", "", "Format output as: text, json.") + label_listCmd.Flags().StringP("page", "p", "", "Page number.") + label_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") labelCmd.AddCommand(label_listCmd) + + carapace.Gen(label_listCmd).FlagCompletion(carapace.ActionMap{ + "output": carapace.ActionValues("text", "json"), + }) } diff --git a/completers/glab_completer/cmd/mr.go b/completers/glab_completer/cmd/mr.go index 59e8cb899f..6816d8a3d0 100644 --- a/completers/glab_completer/cmd/mr.go +++ b/completers/glab_completer/cmd/mr.go @@ -8,14 +8,14 @@ import ( var mrCmd = &cobra.Command{ Use: "mr [flags]", - Short: "Create, view and manage merge requests", + Short: "Create, view, and manage merge requests.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(mrCmd).Standalone() - mrCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + mrCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") rootCmd.AddCommand(mrCmd) carapace.Gen(mrCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/mr_approve.go b/completers/glab_completer/cmd/mr_approve.go index 01d87c18e4..f40b5bdaeb 100644 --- a/completers/glab_completer/cmd/mr_approve.go +++ b/completers/glab_completer/cmd/mr_approve.go @@ -8,14 +8,14 @@ import ( var mr_approveCmd = &cobra.Command{ Use: "approve { | }", - Short: "Approve merge requests", + Short: "Approve merge requests.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(mr_approveCmd).Standalone() - mr_approveCmd.Flags().StringP("sha", "s", "", "SHA which must match the SHA of the HEAD commit of the merge request") + mr_approveCmd.Flags().StringP("sha", "s", "", "SHA, which must match the SHA of the HEAD commit of the merge request.") mrCmd.AddCommand(mr_approveCmd) carapace.Gen(mr_approveCmd).PositionalAnyCompletion( diff --git a/completers/glab_completer/cmd/mr_approvers.go b/completers/glab_completer/cmd/mr_approvers.go index b356d1fc5c..a8f553fb4d 100644 --- a/completers/glab_completer/cmd/mr_approvers.go +++ b/completers/glab_completer/cmd/mr_approvers.go @@ -8,7 +8,7 @@ import ( var mr_approversCmd = &cobra.Command{ Use: "approvers [ | ] [flags]", - Short: "List eligible approvers for merge requests in any state", + Short: "List eligible approvers for merge requests in any state.", Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/mr_checkout.go b/completers/glab_completer/cmd/mr_checkout.go index 78f63d39c0..5a365dffee 100644 --- a/completers/glab_completer/cmd/mr_checkout.go +++ b/completers/glab_completer/cmd/mr_checkout.go @@ -8,16 +8,16 @@ import ( var mr_checkoutCmd = &cobra.Command{ Use: "checkout [ | ]", - Short: "Checkout to an open merge request", + Short: "Check out an open merge request.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(mr_checkoutCmd).Standalone() - mr_checkoutCmd.Flags().StringP("branch", "b", "", "checkout merge request with name") - mr_checkoutCmd.Flags().StringP("set-upstream-to", "u", "", "set tracking of checked out branch to [REMOTE/]BRANCH") - mr_checkoutCmd.Flags().BoolP("track", "t", false, "set checked out branch to track remote branch") + mr_checkoutCmd.Flags().StringP("branch", "b", "", "Check out merge request with name .") + mr_checkoutCmd.Flags().StringP("set-upstream-to", "u", "", "Set tracking of checked-out branch to [REMOTE/]BRANCH.") + mr_checkoutCmd.Flags().BoolP("track", "t", false, "Set checked out branch to track the remote branch.") mr_checkoutCmd.Flag("track").Hidden = true mrCmd.AddCommand(mr_checkoutCmd) diff --git a/completers/glab_completer/cmd/mr_close.go b/completers/glab_completer/cmd/mr_close.go index b38dc72eea..ff1070d168 100644 --- a/completers/glab_completer/cmd/mr_close.go +++ b/completers/glab_completer/cmd/mr_close.go @@ -8,7 +8,7 @@ import ( var mr_closeCmd = &cobra.Command{ Use: "close [ | ]", - Short: "Close merge requests", + Short: "Close a merge request.", Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/mr_create.go b/completers/glab_completer/cmd/mr_create.go index 657631e1ac..f4d9dc06a5 100644 --- a/completers/glab_completer/cmd/mr_create.go +++ b/completers/glab_completer/cmd/mr_create.go @@ -8,7 +8,7 @@ import ( var mr_createCmd = &cobra.Command{ Use: "create", - Short: "Create new merge request", + Short: "Create a new merge request.", Aliases: []string{"new"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,31 +16,32 @@ var mr_createCmd = &cobra.Command{ func init() { carapace.Gen(mr_createCmd).Standalone() - mr_createCmd.Flags().Bool("allow-collaboration", false, "Allow commits from other members") - mr_createCmd.Flags().StringSliceP("assignee", "a", []string{}, "Assign merge request to people by their `usernames`") - mr_createCmd.Flags().Bool("copy-issue-labels", false, "Copy labels from issue to the merge request. Used with --related-issue") - mr_createCmd.Flags().Bool("create-source-branch", false, "Create source branch if it does not exist") - mr_createCmd.Flags().StringP("description", "d", "", "Supply a description for merge request") - mr_createCmd.Flags().Bool("draft", false, "Mark merge request as a draft") - mr_createCmd.Flags().BoolP("fill", "f", false, "Do not prompt for title/description and just use commit info") - mr_createCmd.Flags().Bool("fill-commit-body", false, "Fill description with each commit body when multiple commits. Can only be used with --fill") - mr_createCmd.Flags().StringP("head", "H", "", "Select another head repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or the project ID or full URL") - mr_createCmd.Flags().StringSliceP("label", "l", []string{}, "Add label by name. Multiple labels should be comma separated") - mr_createCmd.Flags().StringP("milestone", "m", "", "The global ID or title of a milestone to assign") - mr_createCmd.Flags().Bool("no-editor", false, "Don't open editor to enter description. If set to true, uses prompt. (default false)") - mr_createCmd.Flags().Bool("push", false, "Push committed changes after creating merge request. Make sure you have committed changes") - mr_createCmd.Flags().Bool("recover", false, "Save the options to a file if the merge request fails to be created. If the file exists, the options will be loaded from the recovery file (EXPERIMENTAL)") - mr_createCmd.Flags().StringP("related-issue", "i", "", "Create merge request for an issue. The merge request title will be created from the issue if --title is not provided.") - mr_createCmd.Flags().Bool("remove-source-branch", false, "Remove Source Branch on merge") - mr_createCmd.Flags().StringSlice("reviewer", []string{}, "Request review from users by their `usernames`") - mr_createCmd.Flags().StringP("source-branch", "s", "", "The Branch you are creating the merge request. Default is the current branch.") - mr_createCmd.Flags().Bool("squash-before-merge", false, "Squash commits into a single commit when merging") - mr_createCmd.Flags().StringP("target-branch", "b", "", "The target or base branch into which you want your code merged") - mr_createCmd.Flags().String("target-project", "", "Add target project by id or OWNER/REPO or GROUP/NAMESPACE/REPO") - mr_createCmd.Flags().StringP("title", "t", "", "Supply a title for merge request") - mr_createCmd.Flags().BoolP("web", "w", false, "continue merge request creation on web browser") - mr_createCmd.Flags().Bool("wip", false, "Mark merge request as a work in progress. Alternative to --draft") - mr_createCmd.Flags().BoolP("yes", "y", false, "Skip submission confirmation prompt, with --fill it skips all optional prompts") + mr_createCmd.Flags().Bool("allow-collaboration", false, "Allow commits from other members.") + mr_createCmd.Flags().StringSliceP("assignee", "a", []string{}, "Assign merge request to people by their `usernames`.") + mr_createCmd.Flags().Bool("copy-issue-labels", false, "Copy labels from issue to the merge request. Used with --related-issue.") + mr_createCmd.Flags().Bool("create-source-branch", false, "Create a source branch if it does not exist.") + mr_createCmd.Flags().StringP("description", "d", "", "Supply a description for the merge request.") + mr_createCmd.Flags().Bool("draft", false, "Mark merge request as a draft.") + mr_createCmd.Flags().BoolP("fill", "f", false, "Do not prompt for title or description, and just use commit info. Sets `push` to `true`, and pushes the branch.") + mr_createCmd.Flags().Bool("fill-commit-body", false, "Fill description with each commit body when multiple commits. Can only be used with --fill.") + mr_createCmd.Flags().StringP("head", "H", "", "Select another head repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format, the project ID, or the full URL.") + mr_createCmd.Flags().StringSliceP("label", "l", []string{}, "Add label by name. Multiple labels should be comma-separated.") + mr_createCmd.Flags().StringP("milestone", "m", "", "The global ID or title of a milestone to assign.") + mr_createCmd.Flags().Bool("no-editor", false, "Don't open editor to enter a description. If true, uses prompt. Defaults to false.") + mr_createCmd.Flags().Bool("push", false, "Push committed changes after creating merge request. Make sure you have committed changes.") + mr_createCmd.Flags().Bool("recover", false, "Save the options to a file if the merge request creation fails. If the file exists, the options are loaded from the recovery file. (EXPERIMENTAL.)") + mr_createCmd.Flags().StringP("related-issue", "i", "", "Create a merge request for an issue. If --title is not provided, uses the issue title.") + mr_createCmd.Flags().Bool("remove-source-branch", false, "Remove source branch on merge.") + mr_createCmd.Flags().StringSlice("reviewer", []string{}, "Request review from users by their `usernames`.") + mr_createCmd.Flags().Bool("signoff", false, "Append a DCO signoff to the merge request description.") + mr_createCmd.Flags().StringP("source-branch", "s", "", "Create a merge request from this branch. Default is the current branch.") + mr_createCmd.Flags().Bool("squash-before-merge", false, "Squash commits into a single commit when merging.") + mr_createCmd.Flags().StringP("target-branch", "b", "", "The target or base branch into which you want your code merged into.") + mr_createCmd.Flags().String("target-project", "", "Add target project by id, OWNER/REPO, or GROUP/NAMESPACE/REPO.") + mr_createCmd.Flags().StringP("title", "t", "", "Supply a title for the merge request.") + mr_createCmd.Flags().BoolP("web", "w", false, "Continue merge request creation in a browser.") + mr_createCmd.Flags().Bool("wip", false, "Mark merge request as a draft. Alternative to --draft.") + mr_createCmd.Flags().BoolP("yes", "y", false, "Skip submission confirmation prompt. Use --fill to skip all optional prompts.") mr_createCmd.Flag("target-project").Hidden = true mrCmd.AddCommand(mr_createCmd) diff --git a/completers/glab_completer/cmd/mr_delete.go b/completers/glab_completer/cmd/mr_delete.go index a24b97f3fd..d872ec8cf7 100644 --- a/completers/glab_completer/cmd/mr_delete.go +++ b/completers/glab_completer/cmd/mr_delete.go @@ -8,7 +8,7 @@ import ( var mr_deleteCmd = &cobra.Command{ Use: "delete [ | ]", - Short: "Delete merge requests", + Short: "Delete a merge request.", Aliases: []string{"del"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/mr_diff.go b/completers/glab_completer/cmd/mr_diff.go index 10eb4da900..b267670612 100644 --- a/completers/glab_completer/cmd/mr_diff.go +++ b/completers/glab_completer/cmd/mr_diff.go @@ -9,14 +9,14 @@ import ( var mr_diffCmd = &cobra.Command{ Use: "diff [ | ]", - Short: "View changes in a merge request", + Short: "View changes in a merge request.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(mr_diffCmd).Standalone() - mr_diffCmd.Flags().String("color", "", "Use color in diff output: {always|never|auto}") + mr_diffCmd.Flags().String("color", "", "Use color in diff output: always, never, auto.") mrCmd.AddCommand(mr_diffCmd) carapace.Gen(mr_diffCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/mr_list.go b/completers/glab_completer/cmd/mr_list.go index 11931822d4..43155dd139 100644 --- a/completers/glab_completer/cmd/mr_list.go +++ b/completers/glab_completer/cmd/mr_list.go @@ -8,7 +8,7 @@ import ( var mr_listCmd = &cobra.Command{ Use: "list [flags]", - Short: "List merge requests", + Short: "List merge requests.", Aliases: []string{"ls"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,25 +16,26 @@ var mr_listCmd = &cobra.Command{ func init() { carapace.Gen(mr_listCmd).Standalone() - mr_listCmd.Flags().BoolP("all", "A", false, "Get all merge requests") - mr_listCmd.Flags().StringSliceP("assignee", "a", []string{}, "Get only merge requests assigned to users") - mr_listCmd.Flags().String("author", "", "Filter merge request by Author ") - mr_listCmd.Flags().BoolP("closed", "c", false, "Get only closed merge requests") - mr_listCmd.Flags().BoolP("draft", "d", false, "Filter by draft merge requests") + mr_listCmd.Flags().BoolP("all", "A", false, "Get all merge requests.") + mr_listCmd.Flags().StringSliceP("assignee", "a", []string{}, "Get only merge requests assigned to users.") + mr_listCmd.Flags().String("author", "", "Filter merge request by author .") + mr_listCmd.Flags().BoolP("closed", "c", false, "Get only closed merge requests.") + mr_listCmd.Flags().BoolP("draft", "d", false, "Filter by draft merge requests.") mr_listCmd.PersistentFlags().StringP("group", "g", "", "Select a group/subgroup. This option is ignored if a repo argument is set.") - mr_listCmd.Flags().StringSliceP("label", "l", []string{}, "Filter merge request by label ") - mr_listCmd.Flags().BoolP("merged", "M", false, "Get only merged merge requests") - mr_listCmd.Flags().StringP("milestone", "m", "", "Filter merge request by milestone ") - mr_listCmd.Flags().Bool("mine", false, "Get only merge requests assigned to me") - mr_listCmd.Flags().StringSlice("not-label", []string{}, "Filter merge requests by not having label ") - mr_listCmd.Flags().BoolP("opened", "o", false, "Get only open merge requests") - mr_listCmd.Flags().StringP("page", "p", "", "Page number") - mr_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page") - mr_listCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") - mr_listCmd.Flags().StringSliceP("reviewer", "r", []string{}, "Get only merge requests with users as reviewer") - mr_listCmd.Flags().String("search", "", "Filter by in title and description") - mr_listCmd.Flags().StringP("source-branch", "s", "", "Filter by source branch ") - mr_listCmd.Flags().StringP("target-branch", "t", "", "Filter by target branch ") + mr_listCmd.Flags().StringSliceP("label", "l", []string{}, "Filter merge request by label .") + mr_listCmd.Flags().BoolP("merged", "M", false, "Get only merged merge requests.") + mr_listCmd.Flags().StringP("milestone", "m", "", "Filter merge request by milestone .") + mr_listCmd.Flags().Bool("mine", false, "Get only merge requests assigned to me.") + mr_listCmd.Flags().StringSlice("not-label", []string{}, "Filter merge requests by not having label .") + mr_listCmd.Flags().BoolP("opened", "O", false, "Get only open merge requests.") + mr_listCmd.Flags().StringP("output", "F", "", "Format output as: text, json.") + mr_listCmd.Flags().StringP("page", "p", "", "Page number.") + mr_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + mr_listCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") + mr_listCmd.Flags().StringSliceP("reviewer", "r", []string{}, "Get only merge requests with users as reviewer.") + mr_listCmd.Flags().String("search", "", "Filter by in title and description.") + mr_listCmd.Flags().StringP("source-branch", "s", "", "Filter by source branch .") + mr_listCmd.Flags().StringP("target-branch", "t", "", "Filter by target branch .") mr_listCmd.Flag("mine").Hidden = true mr_listCmd.Flag("opened").Hidden = true mrCmd.AddCommand(mr_listCmd) diff --git a/completers/glab_completer/cmd/mr_merge.go b/completers/glab_completer/cmd/mr_merge.go index b41370542e..f7dfe0696e 100644 --- a/completers/glab_completer/cmd/mr_merge.go +++ b/completers/glab_completer/cmd/mr_merge.go @@ -8,7 +8,7 @@ import ( var mr_mergeCmd = &cobra.Command{ Use: "merge { | }", - Short: "Merge/Accept merge requests", + Short: "Merge or accept a merge request.", Aliases: []string{"accept"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,15 +16,15 @@ var mr_mergeCmd = &cobra.Command{ func init() { carapace.Gen(mr_mergeCmd).Standalone() - mr_mergeCmd.Flags().Bool("auto-merge", false, "Set auto-merge") - mr_mergeCmd.Flags().StringP("message", "m", "", "Custom merge commit message") - mr_mergeCmd.Flags().BoolP("rebase", "r", false, "Rebase the commits onto the base branch") - mr_mergeCmd.Flags().BoolP("remove-source-branch", "d", false, "Remove source branch on merge") - mr_mergeCmd.Flags().String("sha", "", "Merge Commit sha") - mr_mergeCmd.Flags().BoolP("squash", "s", false, "Squash commits on merge") - mr_mergeCmd.Flags().String("squash-message", "", "Custom Squash commit message") + mr_mergeCmd.Flags().Bool("auto-merge", false, "Set auto-merge.") + mr_mergeCmd.Flags().StringP("message", "m", "", "Custom merge commit message.") + mr_mergeCmd.Flags().BoolP("rebase", "r", false, "Rebase the commits onto the base branch.") + mr_mergeCmd.Flags().BoolP("remove-source-branch", "d", false, "Remove source branch on merge.") + mr_mergeCmd.Flags().String("sha", "", "Merge commit SHA.") + mr_mergeCmd.Flags().BoolP("squash", "s", false, "Squash commits on merge.") + mr_mergeCmd.Flags().String("squash-message", "", "Custom squash commit message.") mr_mergeCmd.Flags().Bool("when-pipeline-succeeds", false, "Merge only when pipeline succeeds") - mr_mergeCmd.Flags().BoolP("yes", "y", false, "Skip submission confirmation prompt") + mr_mergeCmd.Flags().BoolP("yes", "y", false, "Skip submission confirmation prompt.") mr_mergeCmd.Flag("when-pipeline-succeeds").Hidden = true mrCmd.AddCommand(mr_mergeCmd) diff --git a/completers/glab_completer/cmd/mr_note.go b/completers/glab_completer/cmd/mr_note.go index 24f5fae290..c56fa9e632 100644 --- a/completers/glab_completer/cmd/mr_note.go +++ b/completers/glab_completer/cmd/mr_note.go @@ -8,7 +8,7 @@ import ( var mr_noteCmd = &cobra.Command{ Use: "note [ | ]", - Short: "Add a comment or note to merge request", + Short: "Add a comment or note to a merge request.", Aliases: []string{"comment"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,8 +16,8 @@ var mr_noteCmd = &cobra.Command{ func init() { carapace.Gen(mr_noteCmd).Standalone() - mr_noteCmd.Flags().StringP("message", "m", "", "Comment/Note message") - mr_noteCmd.Flags().Bool("unique", false, "Don't create a comment/note if it already exists") + mr_noteCmd.Flags().StringP("message", "m", "", "Comment or note message.") + mr_noteCmd.Flags().Bool("unique", false, "Don't create a comment or note if it already exists.") mrCmd.AddCommand(mr_noteCmd) carapace.Gen(mr_noteCmd).PositionalAnyCompletion( diff --git a/completers/glab_completer/cmd/mr_rebase.go b/completers/glab_completer/cmd/mr_rebase.go index 5f4821db21..6b13bcc26e 100644 --- a/completers/glab_completer/cmd/mr_rebase.go +++ b/completers/glab_completer/cmd/mr_rebase.go @@ -8,7 +8,7 @@ import ( var mr_rebaseCmd = &cobra.Command{ Use: "rebase [ | ] [flags]", - Short: "Automatically rebase the source_branch of the merge request against its target_branch.", + Short: "Rebase the source branch of a merge request against its target branch.", Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/mr_reopen.go b/completers/glab_completer/cmd/mr_reopen.go index e9e355ecd4..7ea5b413ca 100644 --- a/completers/glab_completer/cmd/mr_reopen.go +++ b/completers/glab_completer/cmd/mr_reopen.go @@ -8,7 +8,7 @@ import ( var mr_reopenCmd = &cobra.Command{ Use: "reopen [... | ...]", - Short: "Reopen merge requests", + Short: "Reopen a merge request.", Aliases: []string{"open"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/mr_revoke.go b/completers/glab_completer/cmd/mr_revoke.go index 07f4a498fc..0a878f3dad 100644 --- a/completers/glab_completer/cmd/mr_revoke.go +++ b/completers/glab_completer/cmd/mr_revoke.go @@ -8,7 +8,7 @@ import ( var mr_revokeCmd = &cobra.Command{ Use: "revoke [ | ]", - Short: "Revoke approval on a merge request", + Short: "Revoke approval on a merge request.", Aliases: []string{"unapprove"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/mr_subscribe.go b/completers/glab_completer/cmd/mr_subscribe.go index dd16ce0164..3db36ce5d5 100644 --- a/completers/glab_completer/cmd/mr_subscribe.go +++ b/completers/glab_completer/cmd/mr_subscribe.go @@ -8,7 +8,7 @@ import ( var mr_subscribeCmd = &cobra.Command{ Use: "subscribe [ | ]", - Short: "Subscribe to merge requests", + Short: "Subscribe to a merge request.", Aliases: []string{"sub"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/mr_todo.go b/completers/glab_completer/cmd/mr_todo.go index f9b1b416aa..6b94b785da 100644 --- a/completers/glab_completer/cmd/mr_todo.go +++ b/completers/glab_completer/cmd/mr_todo.go @@ -8,7 +8,7 @@ import ( var mr_todoCmd = &cobra.Command{ Use: "todo [ | ]", - Short: "Add a to-do item to merge request", + Short: "Add a to-do item to merge request.", Aliases: []string{"add-todo"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/mr_unsubscribe.go b/completers/glab_completer/cmd/mr_unsubscribe.go index af3a27ec5e..6f1b0299c1 100644 --- a/completers/glab_completer/cmd/mr_unsubscribe.go +++ b/completers/glab_completer/cmd/mr_unsubscribe.go @@ -8,7 +8,7 @@ import ( var mr_unsubscribeCmd = &cobra.Command{ Use: "unsubscribe [ | ]", - Short: "Unsubscribe from merge requests", + Short: "Unsubscribe from a merge request.", Aliases: []string{"unsub"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/mr_update.go b/completers/glab_completer/cmd/mr_update.go index 01e14f55dd..089ced5a13 100644 --- a/completers/glab_completer/cmd/mr_update.go +++ b/completers/glab_completer/cmd/mr_update.go @@ -8,29 +8,29 @@ import ( var mr_updateCmd = &cobra.Command{ Use: "update [ | ]", - Short: "Update merge requests", + Short: "Update a merge request.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(mr_updateCmd).Standalone() - mr_updateCmd.Flags().StringSliceP("assignee", "a", []string{}, "assign users via username, prefix with '!' or '-' to remove from existing assignees, '+' to add, otherwise replace existing assignees with given users") - mr_updateCmd.Flags().StringP("description", "d", "", "merge request description; set to \"-\" to open an editor") - mr_updateCmd.Flags().Bool("draft", false, "Mark merge request as a draft") - mr_updateCmd.Flags().StringSliceP("label", "l", []string{}, "add labels") - mr_updateCmd.Flags().Bool("lock-discussion", false, "Lock discussion on merge request") - mr_updateCmd.Flags().StringP("milestone", "m", "", "title of the milestone to assign, pass \"\" or 0 to unassign") - mr_updateCmd.Flags().BoolP("ready", "r", false, "Mark merge request as ready to be reviewed and merged") - mr_updateCmd.Flags().Bool("remove-source-branch", false, "Toggles the removal of the Source Branch on merge") - mr_updateCmd.Flags().StringSlice("reviewer", []string{}, "request review from users by their usernames, prefix with '!' or '-' to remove from existing reviewers, '+' to add, otherwise replace existing reviewers with given users") - mr_updateCmd.Flags().Bool("squash-before-merge", false, "Toggles the option to squash commits into a single commit when merging") - mr_updateCmd.Flags().String("target-branch", "", "set target branch") - mr_updateCmd.Flags().StringP("title", "t", "", "Title of merge request") - mr_updateCmd.Flags().Bool("unassign", false, "unassign all users") - mr_updateCmd.Flags().StringSliceP("unlabel", "u", []string{}, "remove labels") - mr_updateCmd.Flags().Bool("unlock-discussion", false, "Unlock discussion on merge request") - mr_updateCmd.Flags().Bool("wip", false, "Mark merge request as a work in progress. Alternative to --draft") + mr_updateCmd.Flags().StringSliceP("assignee", "a", []string{}, "Assign users via username. Prefix with '!' or '-' to remove from existing assignees, '+' to add. Otherwise, replace existing assignees with given users.") + mr_updateCmd.Flags().StringP("description", "d", "", "Merge request description. Set to \"-\" to open an editor.") + mr_updateCmd.Flags().Bool("draft", false, "Mark merge request as a draft.") + mr_updateCmd.Flags().StringSliceP("label", "l", []string{}, "Add labels.") + mr_updateCmd.Flags().Bool("lock-discussion", false, "Lock discussion on merge request.") + mr_updateCmd.Flags().StringP("milestone", "m", "", "Title of the milestone to assign. Set to \"\" or 0 to unassign.") + mr_updateCmd.Flags().BoolP("ready", "r", false, "Mark merge request as ready to be reviewed and merged.") + mr_updateCmd.Flags().Bool("remove-source-branch", false, "Toggles the removal of the source branch on merge.") + mr_updateCmd.Flags().StringSlice("reviewer", []string{}, "Request review from users by their usernames. Prefix with '!' or '-' to remove from existing reviewers, '+' to add. Otherwise, replace existing reviewers with given users.") + mr_updateCmd.Flags().Bool("squash-before-merge", false, "Toggles the option to squash commits into a single commit when merging.") + mr_updateCmd.Flags().String("target-branch", "", "Set target branch.") + mr_updateCmd.Flags().StringP("title", "t", "", "Title of merge request.") + mr_updateCmd.Flags().Bool("unassign", false, "Unassign all users.") + mr_updateCmd.Flags().StringSliceP("unlabel", "u", []string{}, "Remove labels.") + mr_updateCmd.Flags().Bool("unlock-discussion", false, "Unlock discussion on merge request.") + mr_updateCmd.Flags().Bool("wip", false, "Mark merge request as a work in progress. Alternative to --draft.") mrCmd.AddCommand(mr_updateCmd) carapace.Gen(mr_updateCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/mr_view.go b/completers/glab_completer/cmd/mr_view.go index 8f57e312fb..872af620cd 100644 --- a/completers/glab_completer/cmd/mr_view.go +++ b/completers/glab_completer/cmd/mr_view.go @@ -16,13 +16,18 @@ var mr_viewCmd = &cobra.Command{ func init() { carapace.Gen(mr_viewCmd).Standalone() - mr_viewCmd.Flags().BoolP("comments", "c", false, "Show mr comments and activities") - mr_viewCmd.Flags().StringP("page", "p", "", "Page number") - mr_viewCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page") - mr_viewCmd.Flags().BoolP("system-logs", "s", false, "Show system activities / logs") - mr_viewCmd.Flags().BoolP("web", "w", false, "Open mr in a browser. Uses default browser or browser specified in BROWSER variable") + mr_viewCmd.Flags().BoolP("comments", "c", false, "Show merge request comments and activities.") + mr_viewCmd.Flags().StringP("output", "F", "", "Format output as: text, json.") + mr_viewCmd.Flags().StringP("page", "p", "", "Page number.") + mr_viewCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + mr_viewCmd.Flags().BoolP("system-logs", "s", false, "Show system activities and logs.") + mr_viewCmd.Flags().BoolP("web", "w", false, "Open merge request in a browser. Uses default browser or browser specified in BROWSER variable.") mrCmd.AddCommand(mr_viewCmd) + carapace.Gen(mr_viewCmd).FlagCompletion(carapace.ActionMap{ + "output": carapace.ActionValues("text", "json"), + }) + carapace.Gen(mr_viewCmd).PositionalCompletion( action.ActionMergeRequestsAndBranches(mr_viewCmd, "opened"), ) diff --git a/completers/glab_completer/cmd/release.go b/completers/glab_completer/cmd/release.go index fa4ad0f36b..7c898e47f1 100644 --- a/completers/glab_completer/cmd/release.go +++ b/completers/glab_completer/cmd/release.go @@ -8,14 +8,14 @@ import ( var releaseCmd = &cobra.Command{ Use: "release [flags]", - Short: "Manage GitLab releases", + Short: "Manage GitLab releases.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(releaseCmd).Standalone() - releaseCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + releaseCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") rootCmd.AddCommand(releaseCmd) carapace.Gen(releaseCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/release_create.go b/completers/glab_completer/cmd/release_create.go index 27033a7ac8..9c93ff8e10 100644 --- a/completers/glab_completer/cmd/release_create.go +++ b/completers/glab_completer/cmd/release_create.go @@ -8,20 +8,20 @@ import ( var release_createCmd = &cobra.Command{ Use: "create [...]", - Short: "Create a new or update a GitLab Release for a repository", + Short: "Create a new GitLab release, or update an existing one.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(release_createCmd).Standalone() - release_createCmd.Flags().StringP("assets-links", "a", "", "`JSON` string representation of assets links (e.g. `--assets-links='[{\"name\": \"Asset1\", \"url\":\"https:///some/location/1\", \"link_type\": \"other\", \"filepath\": \"path/to/file\"}]')`") - release_createCmd.Flags().StringSliceP("milestone", "m", []string{}, "The title of each milestone the release is associated with") - release_createCmd.Flags().StringP("name", "n", "", "The release name or title") - release_createCmd.Flags().StringP("notes", "N", "", "The release notes/description. You can use Markdown") - release_createCmd.Flags().StringP("notes-file", "F", "", "Read release notes `file`. Specify `-` as value to read from stdin") - release_createCmd.Flags().StringP("ref", "r", "", "If a tag specified doesn't exist, the release is created from ref and tagged with the specified tag name. It can be a commit SHA, another tag name, or a branch name.") - release_createCmd.Flags().StringP("released-at", "D", "", "The `date` when the release is/was ready. Defaults to the current datetime. Expected in ISO 8601 format (2019-03-15T08:00:00Z)") + release_createCmd.Flags().StringP("assets-links", "a", "", "'JSON' string representation of assets links, like `--assets-links='[{\"name\": \"Asset1\", \"url\":\"https:///some/location/1\", \"link_type\": \"other\", \"direct_asset_path\": \"path/to/file\"}]'.`") + release_createCmd.Flags().StringSliceP("milestone", "m", []string{}, "The title of each milestone the release is associated with.") + release_createCmd.Flags().StringP("name", "n", "", "The release name or title.") + release_createCmd.Flags().StringP("notes", "N", "", "The release notes or description. You can use Markdown.") + release_createCmd.Flags().StringP("notes-file", "F", "", "Read release notes 'file'. Specify '-' as the value to read from stdin.") + release_createCmd.Flags().StringP("ref", "r", "", "If the specified tag doesn't exist, the release is created from ref and tagged with the specified tag name. It can be a commit SHA, another tag name, or a branch name.") + release_createCmd.Flags().StringP("released-at", "D", "", "The 'date' when the release was ready. Defaults to the current datetime. Expects ISO 8601 format (2019-03-15T08:00:00Z).") releaseCmd.AddCommand(release_createCmd) carapace.Gen(release_createCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/release_delete.go b/completers/glab_completer/cmd/release_delete.go index c1cf7b8f66..81ece3ef23 100644 --- a/completers/glab_completer/cmd/release_delete.go +++ b/completers/glab_completer/cmd/release_delete.go @@ -8,15 +8,15 @@ import ( var release_deleteCmd = &cobra.Command{ Use: "delete ", - Short: "Delete a GitLab Release", + Short: "Delete a GitLab release.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(release_deleteCmd).Standalone() - release_deleteCmd.Flags().BoolP("with-tag", "t", false, "Delete associated tag") - release_deleteCmd.Flags().BoolP("yes", "y", false, "Skip confirmation prompt") + release_deleteCmd.Flags().BoolP("with-tag", "t", false, "Delete the associated tag.") + release_deleteCmd.Flags().BoolP("yes", "y", false, "Skip the confirmation prompt.") releaseCmd.AddCommand(release_deleteCmd) carapace.Gen(release_deleteCmd).PositionalCompletion( diff --git a/completers/glab_completer/cmd/release_download.go b/completers/glab_completer/cmd/release_download.go index 74498a5519..42ad0ee8a8 100644 --- a/completers/glab_completer/cmd/release_download.go +++ b/completers/glab_completer/cmd/release_download.go @@ -8,15 +8,15 @@ import ( var release_downloadCmd = &cobra.Command{ Use: "download ", - Short: "Download asset files from a GitLab Release", + Short: "Download asset files from a GitLab release.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(release_downloadCmd).Standalone() - release_downloadCmd.Flags().StringSliceP("asset-name", "n", []string{}, "Download only assets that match the name or a glob pattern") - release_downloadCmd.Flags().StringP("dir", "D", "", "Directory to download the release assets to") + release_downloadCmd.Flags().StringSliceP("asset-name", "n", []string{}, "Download only assets that match the name or a glob pattern.") + release_downloadCmd.Flags().StringP("dir", "D", "", "Directory to download the release assets to.") releaseCmd.AddCommand(release_downloadCmd) carapace.Gen(release_downloadCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/release_list.go b/completers/glab_completer/cmd/release_list.go index cc7ee7a740..4588a50adc 100644 --- a/completers/glab_completer/cmd/release_list.go +++ b/completers/glab_completer/cmd/release_list.go @@ -7,7 +7,7 @@ import ( var release_listCmd = &cobra.Command{ Use: "list [flags]", - Short: "List releases in a repository", + Short: "List releases in a repository.", Aliases: []string{"ls"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -15,7 +15,9 @@ var release_listCmd = &cobra.Command{ func init() { carapace.Gen(release_listCmd).Standalone() - release_listCmd.Flags().StringP("tag", "t", "", "Filter releases by tag ") + release_listCmd.Flags().StringP("page", "p", "", "Page number.") + release_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + release_listCmd.Flags().StringP("tag", "t", "", "Filter releases by tag .") release_listCmd.Flag("tag").Hidden = true releaseCmd.AddCommand(release_listCmd) diff --git a/completers/glab_completer/cmd/release_upload.go b/completers/glab_completer/cmd/release_upload.go index d6608e28ae..37ec58a483 100644 --- a/completers/glab_completer/cmd/release_upload.go +++ b/completers/glab_completer/cmd/release_upload.go @@ -8,14 +8,14 @@ import ( var release_uploadCmd = &cobra.Command{ Use: "upload [...]", - Short: "Upload release asset files or links to GitLab Release", + Short: "Upload release asset files or links to a GitLab release.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(release_uploadCmd).Standalone() - release_uploadCmd.Flags().StringP("assets-links", "a", "", "`JSON` string representation of assets links (e.g. `--assets-links='[{\"name\": \"Asset1\", \"url\":\"https:///some/location/1\", \"link_type\": \"other\", \"filepath\": \"path/to/file\"}]')`") + release_uploadCmd.Flags().StringP("assets-links", "a", "", "`JSON` string representation of assets links, like: `--assets-links='[{\"name\": \"Asset1\", \"url\":\"https:///some/location/1\", \"link_type\": \"other\", \"direct_asset_path\": \"path/to/file\"}]'.`") releaseCmd.AddCommand(release_uploadCmd) carapace.Gen(release_uploadCmd).PositionalCompletion( diff --git a/completers/glab_completer/cmd/release_view.go b/completers/glab_completer/cmd/release_view.go index 369097fb8e..d88fc84521 100644 --- a/completers/glab_completer/cmd/release_view.go +++ b/completers/glab_completer/cmd/release_view.go @@ -8,14 +8,14 @@ import ( var release_viewCmd = &cobra.Command{ Use: "view ", - Short: "View information about a GitLab Release", + Short: "View information about a GitLab release.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(release_viewCmd).Standalone() - release_viewCmd.Flags().BoolP("web", "w", false, "Open the release in the browser") + release_viewCmd.Flags().BoolP("web", "w", false, "Open the release in the browser.") releaseCmd.AddCommand(release_viewCmd) carapace.Gen(release_viewCmd).PositionalCompletion( diff --git a/completers/glab_completer/cmd/repo.go b/completers/glab_completer/cmd/repo.go index 7c30178cd1..543fa7a54e 100644 --- a/completers/glab_completer/cmd/repo.go +++ b/completers/glab_completer/cmd/repo.go @@ -7,7 +7,7 @@ import ( var repoCmd = &cobra.Command{ Use: "repo [flags]", - Short: "Work with GitLab repositories and projects", + Short: "Work with GitLab repositories and projects.", Aliases: []string{"project"}, Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/repo_archive.go b/completers/glab_completer/cmd/repo_archive.go index 26be19e4d9..7934d83139 100644 --- a/completers/glab_completer/cmd/repo_archive.go +++ b/completers/glab_completer/cmd/repo_archive.go @@ -15,8 +15,8 @@ var repo_archiveCmd = &cobra.Command{ func init() { carapace.Gen(repo_archiveCmd).Standalone() - repo_archiveCmd.Flags().StringP("format", "f", "", "Optionally Specify format if you want a downloaded archive: {tar.gz|tar.bz2|tbz|tbz2|tb2|bz2|tar|zip}.") - repo_archiveCmd.Flags().StringP("sha", "s", "", "The commit SHA to download. A tag, branch reference, or SHA can be used. This defaults to the tip of the default branch if not specified") + repo_archiveCmd.Flags().StringP("format", "f", "", "Optional. Specify format if you want a downloaded archive: tar.gz, tar.bz2, tbz, tbz2, tb2, bz2, tar, zip.") + repo_archiveCmd.Flags().StringP("sha", "s", "", "The commit SHA to download. A tag, branch reference, or SHA can be used. Defaults to the tip of the default branch if not specified.") repoCmd.AddCommand(repo_archiveCmd) carapace.Gen(repo_archiveCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/repo_clone.go b/completers/glab_completer/cmd/repo_clone.go index ce14a4584d..89e10f53ea 100644 --- a/completers/glab_completer/cmd/repo_clone.go +++ b/completers/glab_completer/cmd/repo_clone.go @@ -8,25 +8,25 @@ import ( var repo_cloneCmd = &cobra.Command{ Use: "clone [flags] [] [-- [...]]", - Short: "Clone a GitLab repository/project", + Short: "Clone a GitLab repository or project.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(repo_cloneCmd).Standalone() - repo_cloneCmd.Flags().BoolP("archived", "a", false, "Limit by archived status. Used with --group flag") - repo_cloneCmd.Flags().StringP("group", "g", "", "Specify group to clone repositories from") - repo_cloneCmd.Flags().BoolP("include-subgroups", "G", false, "Include projects in subgroups of this group. Default is true. Used with --group flag") - repo_cloneCmd.Flags().BoolP("mine", "m", false, "Limit by projects in the group owned by the current authenticated user. Used with --group flag") - repo_cloneCmd.Flags().String("page", "", "Page number") - repo_cloneCmd.Flags().Bool("paginate", false, "Make additional HTTP requests to fetch all pages of projects before cloning. Respects --per-page") - repo_cloneCmd.Flags().String("per-page", "", "Number of items to list per page") - repo_cloneCmd.Flags().BoolP("preserve-namespace", "p", false, "Clone the repo in a subdirectory based on namespace") - repo_cloneCmd.Flags().StringP("visibility", "v", "", "Limit by visibility {public, internal, or private}. Used with --group flag") - repo_cloneCmd.Flags().BoolP("with-issues-enabled", "I", false, "Limit by projects with issues feature enabled. Default is false. Used with --group flag") - repo_cloneCmd.Flags().BoolP("with-mr-enabled", "M", false, "Limit by projects with merge requests feature enabled. Default is false. Used with --group flag") - repo_cloneCmd.Flags().BoolP("with-shared", "S", false, "Include projects shared to this group. Default is false. Used with --group flag") + repo_cloneCmd.Flags().BoolP("archived", "a", false, "Limit by archived status. Use with '-a=false' to exclude archived repositories. Used with the --group flag.") + repo_cloneCmd.Flags().StringP("group", "g", "", "Specify the group to clone repositories from.") + repo_cloneCmd.Flags().BoolP("include-subgroups", "G", false, "Include projects in subgroups of this group. Default is true. Used with the --group flag.") + repo_cloneCmd.Flags().BoolP("mine", "m", false, "Limit by projects in the group owned by the current authenticated user. Used with the --group flag.") + repo_cloneCmd.Flags().String("page", "", "Page number.") + repo_cloneCmd.Flags().Bool("paginate", false, "Make additional HTTP requests to fetch all pages of projects before cloning. Respects --per-page.") + repo_cloneCmd.Flags().String("per-page", "", "Number of items to list per page.") + repo_cloneCmd.Flags().BoolP("preserve-namespace", "p", false, "Clone the repository in a subdirectory based on namespace.") + repo_cloneCmd.Flags().StringP("visibility", "v", "", "Limit by visibility: public, internal, private. Used with the --group flag.") + repo_cloneCmd.Flags().BoolP("with-issues-enabled", "I", false, "Limit by projects with the issues feature enabled. Default is false. Used with the --group flag.") + repo_cloneCmd.Flags().BoolP("with-mr-enabled", "M", false, "Limit by projects with the merge request feature enabled. Default is false. Used with the --group flag.") + repo_cloneCmd.Flags().BoolP("with-shared", "S", false, "Include projects shared to this group. Default is true. Used with the --group flag.") repoCmd.AddCommand(repo_cloneCmd) carapace.Gen(repo_cloneCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/repo_contributors.go b/completers/glab_completer/cmd/repo_contributors.go index 4091ad579a..34d2085622 100644 --- a/completers/glab_completer/cmd/repo_contributors.go +++ b/completers/glab_completer/cmd/repo_contributors.go @@ -16,11 +16,11 @@ var repo_contributorsCmd = &cobra.Command{ func init() { carapace.Gen(repo_contributorsCmd).Standalone() - repo_contributorsCmd.Flags().StringP("order", "o", "", "Return contributors ordered by name, email, or commits (orders by commit date) fields") - repo_contributorsCmd.Flags().StringP("page", "p", "", "Page number") + repo_contributorsCmd.Flags().StringP("order", "o", "", "Return contributors ordered by name, email, or commits (orders by commit date) fields.") + repo_contributorsCmd.Flags().StringP("page", "p", "", "Page number.") repo_contributorsCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") - repo_contributorsCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") - repo_contributorsCmd.Flags().StringP("sort", "s", "", "Return contributors sorted in asc or desc order") + repo_contributorsCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") + repo_contributorsCmd.Flags().StringP("sort", "s", "", "Return contributors. Sort options: asc, desc.") repoCmd.AddCommand(repo_contributorsCmd) carapace.Gen(repo_contributorsCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/repo_create.go b/completers/glab_completer/cmd/repo_create.go index 94116ef2aa..8d970260b2 100644 --- a/completers/glab_completer/cmd/repo_create.go +++ b/completers/glab_completer/cmd/repo_create.go @@ -15,15 +15,15 @@ var repo_createCmd = &cobra.Command{ func init() { carapace.Gen(repo_createCmd).Standalone() - repo_createCmd.Flags().String("defaultBranch", "", "Default branch of the project. If not provided, `master` by default.") - repo_createCmd.Flags().StringP("description", "d", "", "Description of the new project") - repo_createCmd.Flags().StringP("group", "g", "", "Namespace/group for the new project (defaults to the current user’s namespace)") - repo_createCmd.Flags().Bool("internal", false, "Make project internal: visible to any authenticated user (default)") - repo_createCmd.Flags().StringP("name", "n", "", "Name of the new project") - repo_createCmd.Flags().BoolP("private", "p", false, "Make project private: visible only to project members") - repo_createCmd.Flags().BoolP("public", "P", false, "Make project public: visible without any authentication") - repo_createCmd.Flags().Bool("readme", false, "Initialize project with README.md") - repo_createCmd.Flags().String("remoteName", "", "Remote name for the Git repository you're in. If not provided, `origin` by default.") + repo_createCmd.Flags().String("defaultBranch", "", "Default branch of the project. Defaults to `master` if not provided.") + repo_createCmd.Flags().StringP("description", "d", "", "Description of the new project.") + repo_createCmd.Flags().StringP("group", "g", "", "Namespace or group for the new project. Defaults to the current user's namespace.") + repo_createCmd.Flags().Bool("internal", false, "Make project internal: visible to any authenticated user. Default.") + repo_createCmd.Flags().StringP("name", "n", "", "Name of the new project.") + repo_createCmd.Flags().BoolP("private", "p", false, "Make project private: visible only to project members.") + repo_createCmd.Flags().BoolP("public", "P", false, "Make project public: visible without any authentication.") + repo_createCmd.Flags().Bool("readme", false, "Initialize project with `README.md`.") + repo_createCmd.Flags().String("remoteName", "", "Remote name for the Git repository you're in. Defaults to `origin` if not provided.") repo_createCmd.Flags().StringSliceP("tag", "t", []string{}, "The list of tags for the project.") repoCmd.AddCommand(repo_createCmd) diff --git a/completers/glab_completer/cmd/repo_fork.go b/completers/glab_completer/cmd/repo_fork.go index d0af0951da..2a695833dc 100644 --- a/completers/glab_completer/cmd/repo_fork.go +++ b/completers/glab_completer/cmd/repo_fork.go @@ -8,17 +8,17 @@ import ( var repo_forkCmd = &cobra.Command{ Use: "fork ", - Short: "Create a fork of a GitLab repository", + Short: "Fork a GitLab repository.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(repo_forkCmd).Standalone() - repo_forkCmd.Flags().BoolP("clone", "c", false, "Clone the fork {true|false}") - repo_forkCmd.Flags().StringP("name", "n", "", "The name assigned to the resultant project after forking") - repo_forkCmd.Flags().StringP("path", "p", "", "The path assigned to the resultant project after forking") - repo_forkCmd.Flags().Bool("remote", false, "Add remote for fork {true|false}") + repo_forkCmd.Flags().BoolP("clone", "c", false, "Clone the fork. Options: true, false.") + repo_forkCmd.Flags().StringP("name", "n", "", "The name assigned to the new project after forking.") + repo_forkCmd.Flags().StringP("path", "p", "", "The path assigned to the new project after forking.") + repo_forkCmd.Flags().Bool("remote", false, "Add a remote for the fork. Options: true, false.") repoCmd.AddCommand(repo_forkCmd) // TODO path completion diff --git a/completers/glab_completer/cmd/repo_list.go b/completers/glab_completer/cmd/repo_list.go index e1f5ad8cfd..1567089613 100644 --- a/completers/glab_completer/cmd/repo_list.go +++ b/completers/glab_completer/cmd/repo_list.go @@ -8,25 +8,30 @@ import ( var repo_listCmd = &cobra.Command{ Use: "list", Short: "Get list of repositories.", - Aliases: []string{"users"}, + Aliases: []string{"ls"}, Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(repo_listCmd).Standalone() - repo_listCmd.Flags().BoolP("all", "a", false, "List all projects on the instance") - repo_listCmd.Flags().Bool("member", false, "Only list projects which you are a member") - repo_listCmd.Flags().BoolP("mine", "m", false, "Only list projects you own (default if no filters are passed)") - repo_listCmd.Flags().StringP("order", "o", "", "Return repositories ordered by id, created_at, or other fields") - repo_listCmd.Flags().StringP("page", "p", "", "Page number") - repo_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page") - repo_listCmd.Flags().StringP("sort", "s", "", "Return repositories sorted in asc or desc order") - repo_listCmd.Flags().Bool("starred", false, "Only list starred projects") + repo_listCmd.Flags().BoolP("all", "a", false, "List all projects on the instance.") + repo_listCmd.Flags().Bool("archived", false, "Limit by archived status. Used with the '--group' flag.") + repo_listCmd.Flags().StringP("group", "g", "", "Return repositories in only the given group.") + repo_listCmd.Flags().BoolP("include-subgroups", "G", false, "Include projects in subgroups of this group. Default is false. Used with the '--group' flag.") + repo_listCmd.Flags().Bool("member", false, "List only projects of which you are a member.") + repo_listCmd.Flags().BoolP("mine", "m", false, "List only projects you own. Default if no filters are provided.") + repo_listCmd.Flags().StringP("order", "o", "", "Return repositories ordered by id, created_at, or other fields.") + repo_listCmd.Flags().StringP("output", "F", "", "Format output as: text, json.") + repo_listCmd.Flags().StringP("page", "p", "", "Page number.") + repo_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + repo_listCmd.Flags().StringP("sort", "s", "", "Return repositories sorted in asc or desc order.") + repo_listCmd.Flags().Bool("starred", false, "List only starred projects.") repoCmd.AddCommand(repo_listCmd) carapace.Gen(repo_listCmd).FlagCompletion(carapace.ActionMap{ - "order": carapace.ActionValues("id", "name", "path", "created_at", "updated_at", "last_activity_at", "repository_size", "storage_size", "packages_size", "wiki_size"), - "sort": carapace.ActionValues("asc", "desc"), + "order": carapace.ActionValues("id", "name", "path", "created_at", "updated_at", "last_activity_at", "repository_size", "storage_size", "packages_size", "wiki_size"), + "output": carapace.ActionValues("text", "json"), + "sort": carapace.ActionValues("asc", "desc"), }) } diff --git a/completers/glab_completer/cmd/repo_mirror.go b/completers/glab_completer/cmd/repo_mirror.go index 11305d10bf..5659ea8842 100644 --- a/completers/glab_completer/cmd/repo_mirror.go +++ b/completers/glab_completer/cmd/repo_mirror.go @@ -8,7 +8,7 @@ import ( var repo_mirrorCmd = &cobra.Command{ Use: "mirror [ID | URL | PATH] [flags]", - Short: "Mirror a project/repository to the specified location using pull or push method.", + Short: "Mirror a project or repository to the specified location, using pull or push methods.", Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,7 +16,7 @@ func init() { carapace.Gen(repo_mirrorCmd).Standalone() repo_mirrorCmd.Flags().Bool("allow-divergence", false, "Determines if divergent refs are skipped.") - repo_mirrorCmd.Flags().String("direction", "", "Mirror direction") + repo_mirrorCmd.Flags().String("direction", "", "Mirror direction. Options: pull, push.") repo_mirrorCmd.Flags().Bool("enabled", false, "Determines if the mirror is enabled.") repo_mirrorCmd.Flags().Bool("protected-branches-only", false, "Determines if only protected branches are mirrored.") repo_mirrorCmd.Flags().String("url", "", "The target URL to which the repository is mirrored.") diff --git a/completers/glab_completer/cmd/repo_search.go b/completers/glab_completer/cmd/repo_search.go index 5ca1575207..4f9f11e1b2 100644 --- a/completers/glab_completer/cmd/repo_search.go +++ b/completers/glab_completer/cmd/repo_search.go @@ -7,7 +7,7 @@ import ( var repo_searchCmd = &cobra.Command{ Use: "search [flags]", - Short: "Search for GitLab repositories and projects by name", + Short: "Search for GitLab repositories and projects by name.", Aliases: []string{"find", "lookup"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -15,9 +15,8 @@ var repo_searchCmd = &cobra.Command{ func init() { carapace.Gen(repo_searchCmd).Standalone() - repo_searchCmd.Flags().StringP("page", "p", "", "Page number") - repo_searchCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page") - repo_searchCmd.Flags().StringP("search", "s", "", "A string contained in the project name") - repo_searchCmd.MarkFlagRequired("search") + repo_searchCmd.Flags().StringP("page", "p", "", "Page number.") + repo_searchCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + repo_searchCmd.Flags().StringP("search", "s", "", "A string contained in the project name.") repoCmd.AddCommand(repo_searchCmd) } diff --git a/completers/glab_completer/cmd/repo_transfer.go b/completers/glab_completer/cmd/repo_transfer.go index 63bf2b1fe2..65c2f803af 100644 --- a/completers/glab_completer/cmd/repo_transfer.go +++ b/completers/glab_completer/cmd/repo_transfer.go @@ -15,8 +15,8 @@ var repo_transferCmd = &cobra.Command{ func init() { carapace.Gen(repo_transferCmd).Standalone() - repo_transferCmd.Flags().StringP("target-namespace", "t", "", "The namespace where your project should be transferred to") - repo_transferCmd.Flags().BoolP("yes", "y", false, "Danger: Skip confirmation prompt and force transfer operation. Transfer cannot be undone.") + repo_transferCmd.Flags().StringP("target-namespace", "t", "", "The namespace where your project should be transferred to.") + repo_transferCmd.Flags().BoolP("yes", "y", false, "Warning: Skip confirmation prompt and force transfer operation. Transfer cannot be undone.") repo_transferCmd.MarkFlagRequired("target-namespace") repoCmd.AddCommand(repo_transferCmd) diff --git a/completers/glab_completer/cmd/repo_view.go b/completers/glab_completer/cmd/repo_view.go index 90d77b625d..1ee1775b67 100644 --- a/completers/glab_completer/cmd/repo_view.go +++ b/completers/glab_completer/cmd/repo_view.go @@ -8,15 +8,16 @@ import ( var repo_viewCmd = &cobra.Command{ Use: "view [repository] [flags]", - Short: "View a project/repository", + Short: "View a project or repository.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(repo_viewCmd).Standalone() - repo_viewCmd.Flags().StringP("branch", "b", "", "View a specific branch of the repository") - repo_viewCmd.Flags().BoolP("web", "w", false, "Open a project in the browser") + repo_viewCmd.Flags().StringP("branch", "b", "", "View a specific branch of the repository.") + repo_viewCmd.Flags().StringP("output", "F", "", "Format output as: text, json.") + repo_viewCmd.Flags().BoolP("web", "w", false, "Open a project in the browser.") repoCmd.AddCommand(repo_viewCmd) carapace.Gen(repo_viewCmd).FlagCompletion(carapace.ActionMap{ @@ -27,6 +28,7 @@ func init() { } return carapace.ActionValues() }), + "output": carapace.ActionValues("text", "json"), }) carapace.Gen(repo_viewCmd).PositionalCompletion( diff --git a/completers/glab_completer/cmd/root.go b/completers/glab_completer/cmd/root.go index 284254010e..6248514544 100644 --- a/completers/glab_completer/cmd/root.go +++ b/completers/glab_completer/cmd/root.go @@ -20,7 +20,7 @@ func Execute() error { func init() { carapace.Gen(rootCmd).Standalone() - rootCmd.PersistentFlags().Bool("help", false, "Show help for command") + rootCmd.PersistentFlags().Bool("help", false, "Show help for this command.") rootCmd.Flags().BoolP("version", "v", false, "show glab version information") carapace.Gen(rootCmd).PreRun(func(cmd *cobra.Command, args []string) { diff --git a/completers/glab_completer/cmd/schedule.go b/completers/glab_completer/cmd/schedule.go index fe5747ea2c..f1500c3646 100644 --- a/completers/glab_completer/cmd/schedule.go +++ b/completers/glab_completer/cmd/schedule.go @@ -8,7 +8,7 @@ import ( var scheduleCmd = &cobra.Command{ Use: "schedule [flags]", - Short: "Work with GitLab CI schedules", + Short: "Work with GitLab CI/CD schedules.", Aliases: []string{"sched", "skd"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,7 +16,7 @@ var scheduleCmd = &cobra.Command{ func init() { carapace.Gen(scheduleCmd).Standalone() - scheduleCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + scheduleCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") rootCmd.AddCommand(scheduleCmd) carapace.Gen(scheduleCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/schedule_create.go b/completers/glab_completer/cmd/schedule_create.go index ee848e2538..eb15a4ee85 100644 --- a/completers/glab_completer/cmd/schedule_create.go +++ b/completers/glab_completer/cmd/schedule_create.go @@ -14,11 +14,12 @@ var schedule_createCmd = &cobra.Command{ func init() { carapace.Gen(schedule_createCmd).Standalone() - schedule_createCmd.Flags().Bool("active", false, "Whether or not the schedule is active") - schedule_createCmd.Flags().String("cron", "", "Cron interval pattern") - schedule_createCmd.Flags().String("cronTimeZone", "", "Cron timezone") - schedule_createCmd.Flags().String("description", "", "Description of the schedule") - schedule_createCmd.Flags().String("ref", "", "Target branch or tag") + schedule_createCmd.Flags().Bool("active", false, "Whether or not the schedule is active.") + schedule_createCmd.Flags().String("cron", "", "Cron interval pattern.") + schedule_createCmd.Flags().String("cronTimeZone", "", "Cron timezone.") + schedule_createCmd.Flags().String("description", "", "Description of the schedule.") + schedule_createCmd.Flags().String("ref", "", "Target branch or tag.") + schedule_createCmd.Flags().StringSlice("variable", []string{}, "Pass variables to schedule in the format :.") schedule_createCmd.MarkFlagRequired("cron") schedule_createCmd.MarkFlagRequired("description") schedule_createCmd.MarkFlagRequired("ref") diff --git a/completers/glab_completer/cmd/schedule_delete.go b/completers/glab_completer/cmd/schedule_delete.go index 3b55934e3b..3b221f7e62 100644 --- a/completers/glab_completer/cmd/schedule_delete.go +++ b/completers/glab_completer/cmd/schedule_delete.go @@ -7,7 +7,7 @@ import ( var schedule_deleteCmd = &cobra.Command{ Use: "delete [flags]", - Short: "Delete schedule with the specified ID.", + Short: "Delete the schedule with the specified ID.", Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/schedule_list.go b/completers/glab_completer/cmd/schedule_list.go index e778dd60a7..db53842909 100644 --- a/completers/glab_completer/cmd/schedule_list.go +++ b/completers/glab_completer/cmd/schedule_list.go @@ -7,14 +7,14 @@ import ( var schedule_listCmd = &cobra.Command{ Use: "list [flags]", - Short: "Get the list of schedules", + Short: "Get the list of schedules.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(schedule_listCmd).Standalone() - schedule_listCmd.Flags().StringP("page", "p", "", "Page number") + schedule_listCmd.Flags().StringP("page", "p", "", "Page number.") schedule_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") scheduleCmd.AddCommand(schedule_listCmd) } diff --git a/completers/glab_completer/cmd/snippet.go b/completers/glab_completer/cmd/snippet.go index b42fb16bac..00f2b29cda 100644 --- a/completers/glab_completer/cmd/snippet.go +++ b/completers/glab_completer/cmd/snippet.go @@ -8,14 +8,14 @@ import ( var snippetCmd = &cobra.Command{ Use: "snippet [flags]", - Short: "Create, view and manage snippets", + Short: "Create, view and manage snippets.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(snippetCmd).Standalone() - snippetCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + snippetCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") rootCmd.AddCommand(snippetCmd) carapace.Gen(snippetCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/snippet_create.go b/completers/glab_completer/cmd/snippet_create.go index 6138294049..50d52948de 100644 --- a/completers/glab_completer/cmd/snippet_create.go +++ b/completers/glab_completer/cmd/snippet_create.go @@ -7,7 +7,7 @@ import ( var snippet_createCmd = &cobra.Command{ Use: "create [path]", - Short: "Create new snippet", + Short: "Create a new snippet.", Aliases: []string{"new"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -15,10 +15,11 @@ var snippet_createCmd = &cobra.Command{ func init() { carapace.Gen(snippet_createCmd).Standalone() - snippet_createCmd.Flags().StringP("description", "d", "", "Description of the snippet") - snippet_createCmd.Flags().StringP("filename", "f", "", "Filename of the snippet in GitLab") - snippet_createCmd.Flags().StringP("title", "t", "", "Title of the snippet") - snippet_createCmd.Flags().StringP("visibility", "v", "", "Limit by visibility {public, internal, or private}") + snippet_createCmd.Flags().StringP("description", "d", "", "Description of the snippet.") + snippet_createCmd.Flags().StringP("filename", "f", "", "Filename of the snippet in GitLab.") + snippet_createCmd.Flags().BoolP("personal", "p", false, "Create a personal snippet.") + snippet_createCmd.Flags().StringP("title", "t", "", "Title of the snippet.") + snippet_createCmd.Flags().StringP("visibility", "v", "", "Limit by visibility: 'public', 'internal', or 'private'") snippetCmd.AddCommand(snippet_createCmd) carapace.Gen(snippet_createCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/sshKey.go b/completers/glab_completer/cmd/sshKey.go index 970a0c084c..ff326a3a47 100644 --- a/completers/glab_completer/cmd/sshKey.go +++ b/completers/glab_completer/cmd/sshKey.go @@ -15,7 +15,7 @@ var sshKeyCmd = &cobra.Command{ func init() { carapace.Gen(sshKeyCmd).Standalone() - sshKeyCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + sshKeyCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") rootCmd.AddCommand(sshKeyCmd) carapace.Gen(sshKeyCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/sshKey_add.go b/completers/glab_completer/cmd/sshKey_add.go index b348b322c7..c05a0788f0 100644 --- a/completers/glab_completer/cmd/sshKey_add.go +++ b/completers/glab_completer/cmd/sshKey_add.go @@ -7,15 +7,15 @@ import ( var sshKey_addCmd = &cobra.Command{ Use: "add [key-file]", - Short: "Add an SSH key to your GitLab account", + Short: "Add an SSH key to your GitLab account.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(sshKey_addCmd).Standalone() - sshKey_addCmd.Flags().StringP("expires-at", "e", "", "The expiration date of the SSH key in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ)") - sshKey_addCmd.Flags().StringP("title", "t", "", "New SSH key's title") + sshKey_addCmd.Flags().StringP("expires-at", "e", "", "The expiration date of the SSH key. Uses ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.") + sshKey_addCmd.Flags().StringP("title", "t", "", "New SSH key's title.") sshKey_addCmd.MarkFlagRequired("title") sshKeyCmd.AddCommand(sshKey_addCmd) diff --git a/completers/glab_completer/cmd/sshKey_delete.go b/completers/glab_completer/cmd/sshKey_delete.go new file mode 100644 index 0000000000..aa7a4ecf4b --- /dev/null +++ b/completers/glab_completer/cmd/sshKey_delete.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var sshKey_deleteCmd = &cobra.Command{ + Use: "delete ", + Short: "Deletes a single SSH key specified by the ID.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(sshKey_deleteCmd).Standalone() + + sshKey_deleteCmd.Flags().StringP("page", "p", "", "Page number.") + sshKey_deleteCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + sshKeyCmd.AddCommand(sshKey_deleteCmd) +} diff --git a/completers/glab_completer/cmd/sshKey_get.go b/completers/glab_completer/cmd/sshKey_get.go index ddbd587aec..767b1b9aaa 100644 --- a/completers/glab_completer/cmd/sshKey_get.go +++ b/completers/glab_completer/cmd/sshKey_get.go @@ -15,6 +15,8 @@ var sshKey_getCmd = &cobra.Command{ func init() { carapace.Gen(sshKey_getCmd).Standalone() + sshKey_getCmd.Flags().StringP("page", "p", "", "Page number.") + sshKey_getCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") sshKeyCmd.AddCommand(sshKey_getCmd) carapace.Gen(sshKey_getCmd).PositionalCompletion( diff --git a/completers/glab_completer/cmd/sshKey_list.go b/completers/glab_completer/cmd/sshKey_list.go index b84504bf76..60c5bdf3ed 100644 --- a/completers/glab_completer/cmd/sshKey_list.go +++ b/completers/glab_completer/cmd/sshKey_list.go @@ -7,15 +7,15 @@ import ( var sshKey_listCmd = &cobra.Command{ Use: "list", - Short: "Get a list of currently authenticated user's SSH keys.", + Short: "Get a list of SSH keys for the currently authenticated user.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(sshKey_listCmd).Standalone() - sshKey_listCmd.Flags().StringP("page", "p", "", "Page number") - sshKey_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page") - sshKey_listCmd.Flags().Bool("show-id", false, "Shows IDs of SSH Keys") + sshKey_listCmd.Flags().StringP("page", "p", "", "Page number.") + sshKey_listCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") + sshKey_listCmd.Flags().Bool("show-id", false, "Shows IDs of SSH keys.") sshKeyCmd.AddCommand(sshKey_listCmd) } diff --git a/completers/glab_completer/cmd/stack.go b/completers/glab_completer/cmd/stack.go new file mode 100644 index 0000000000..48735bf76d --- /dev/null +++ b/completers/glab_completer/cmd/stack.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stackCmd = &cobra.Command{ + Use: "stack [flags]", + Short: "Create, manage, and work with stacked diffs. (EXPERIMENTAL.)", + Aliases: []string{"stacks"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stackCmd).Standalone() + + stackCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") + rootCmd.AddCommand(stackCmd) +} diff --git a/completers/glab_completer/cmd/stack_amend.go b/completers/glab_completer/cmd/stack_amend.go new file mode 100644 index 0000000000..da1959f09a --- /dev/null +++ b/completers/glab_completer/cmd/stack_amend.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stack_amendCmd = &cobra.Command{ + Use: "amend", + Short: "Save more changes to a stacked diff. (EXPERIMENTAL.)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stack_amendCmd).Standalone() + + stack_amendCmd.Flags().StringP("description", "d", "", "a description of the change") + stack_amendCmd.Flags().StringP("message", "m", "", "alias for the description flag") + stackCmd.AddCommand(stack_amendCmd) +} diff --git a/completers/glab_completer/cmd/stack_create.go b/completers/glab_completer/cmd/stack_create.go new file mode 100644 index 0000000000..bab94c9889 --- /dev/null +++ b/completers/glab_completer/cmd/stack_create.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stack_createCmd = &cobra.Command{ + Use: "create", + Short: "Create a new stacked diff. (EXPERIMENTAL.)", + Aliases: []string{"new"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stack_createCmd).Standalone() + + stackCmd.AddCommand(stack_createCmd) +} diff --git a/completers/glab_completer/cmd/stack_first.go b/completers/glab_completer/cmd/stack_first.go new file mode 100644 index 0000000000..f1d142d93c --- /dev/null +++ b/completers/glab_completer/cmd/stack_first.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stack_firstCmd = &cobra.Command{ + Use: "first", + Short: "Moves to the first diff in the stack. (EXPERIMENTAL.)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stack_firstCmd).Standalone() + + stackCmd.AddCommand(stack_firstCmd) +} diff --git a/completers/glab_completer/cmd/stack_last.go b/completers/glab_completer/cmd/stack_last.go new file mode 100644 index 0000000000..1361f95277 --- /dev/null +++ b/completers/glab_completer/cmd/stack_last.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stack_lastCmd = &cobra.Command{ + Use: "last", + Short: "Moves to the last diff in the stack. (EXPERIMENTAL.)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stack_lastCmd).Standalone() + + stackCmd.AddCommand(stack_lastCmd) +} diff --git a/completers/glab_completer/cmd/stack_list.go b/completers/glab_completer/cmd/stack_list.go new file mode 100644 index 0000000000..3da54fb722 --- /dev/null +++ b/completers/glab_completer/cmd/stack_list.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stack_listCmd = &cobra.Command{ + Use: "list", + Short: "Lists all entries in the stack. (EXPERIMENTAL.)", + Aliases: []string{"ls"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stack_listCmd).Standalone() + + stackCmd.AddCommand(stack_listCmd) +} diff --git a/completers/glab_completer/cmd/stack_move.go b/completers/glab_completer/cmd/stack_move.go new file mode 100644 index 0000000000..f73736653b --- /dev/null +++ b/completers/glab_completer/cmd/stack_move.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stack_moveCmd = &cobra.Command{ + Use: "move", + Short: "Moves to any selected entry in the stack. (EXPERIMENTAL.)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stack_moveCmd).Standalone() + + stackCmd.AddCommand(stack_moveCmd) +} diff --git a/completers/glab_completer/cmd/stack_next.go b/completers/glab_completer/cmd/stack_next.go new file mode 100644 index 0000000000..d4fcc544a1 --- /dev/null +++ b/completers/glab_completer/cmd/stack_next.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stack_nextCmd = &cobra.Command{ + Use: "next", + Short: "Moves to the next diff in the stack. (EXPERIMENTAL.)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stack_nextCmd).Standalone() + + stackCmd.AddCommand(stack_nextCmd) +} diff --git a/completers/glab_completer/cmd/stack_prev.go b/completers/glab_completer/cmd/stack_prev.go new file mode 100644 index 0000000000..5d39dfa61a --- /dev/null +++ b/completers/glab_completer/cmd/stack_prev.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stack_prevCmd = &cobra.Command{ + Use: "prev", + Short: "Moves to the previous diff in the stack. (EXPERIMENTAL.)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stack_prevCmd).Standalone() + + stackCmd.AddCommand(stack_prevCmd) +} diff --git a/completers/glab_completer/cmd/stack_save.go b/completers/glab_completer/cmd/stack_save.go new file mode 100644 index 0000000000..4e55075c7b --- /dev/null +++ b/completers/glab_completer/cmd/stack_save.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stack_saveCmd = &cobra.Command{ + Use: "save", + Short: "Save your progress within a stacked diff. (EXPERIMENTAL.)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stack_saveCmd).Standalone() + + stack_saveCmd.Flags().StringP("description", "d", "", "Description of the change.") + stack_saveCmd.Flags().StringP("message", "m", "", "Alias for the description flag.") + stackCmd.AddCommand(stack_saveCmd) +} diff --git a/completers/glab_completer/cmd/stack_sync.go b/completers/glab_completer/cmd/stack_sync.go new file mode 100644 index 0000000000..b59aa0521e --- /dev/null +++ b/completers/glab_completer/cmd/stack_sync.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var stack_syncCmd = &cobra.Command{ + Use: "sync", + Short: "Sync and submit progress on a stacked diff. (EXPERIMENTAL.)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(stack_syncCmd).Standalone() + + stackCmd.AddCommand(stack_syncCmd) +} diff --git a/completers/glab_completer/cmd/token.go b/completers/glab_completer/cmd/token.go new file mode 100644 index 0000000000..ad7a4ea73f --- /dev/null +++ b/completers/glab_completer/cmd/token.go @@ -0,0 +1,25 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers/glab_completer/cmd/action" + "github.com/spf13/cobra" +) + +var tokenCmd = &cobra.Command{ + Use: "token", + Short: "Manage personal, project, or group tokens", + Aliases: []string{"tok"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(tokenCmd).Standalone() + + tokenCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") + rootCmd.AddCommand(tokenCmd) + + carapace.Gen(tokenCmd).FlagCompletion(carapace.ActionMap{ + "repo": action.ActionRepo(tokenCmd), + }) +} diff --git a/completers/glab_completer/cmd/token_create.go b/completers/glab_completer/cmd/token_create.go new file mode 100644 index 0000000000..1ed8e89a94 --- /dev/null +++ b/completers/glab_completer/cmd/token_create.go @@ -0,0 +1,36 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/completers_release/glab_completer/cmd/action" + "github.com/spf13/cobra" +) + +var token_createCmd = &cobra.Command{ + Use: "create ", + Short: "Creates user, group, or project access tokens.", + Aliases: []string{"create", "new"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(token_createCmd).Standalone() + + token_createCmd.Flags().StringP("access-level", "A", "", "Access level of the token: one of 'guest', 'reporter', 'developer', 'maintainer', 'owner'.") + token_createCmd.Flags().StringP("duration", "D", "", "Sets the token duration, in hours. Maximum of 8760. Examples: 24h, 168h, 504w.") + token_createCmd.Flags().StringP("expires-at", "E", "", "Sets the token's expiration date and time, in YYYY-MM-DD format. If not specified, --duration is used.") + token_createCmd.Flags().StringP("group", "g", "", "Create a group access token. Ignored if a user or repository argument is set.") + token_createCmd.Flags().StringP("output", "F", "", "Format output as 'text' for the token value, 'json' for the actual API token structure.") + token_createCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") + token_createCmd.Flags().StringSliceP("scope", "S", []string{}, "Scopes for the token. For a list, see https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#personal-access-token-scopes.") + token_createCmd.Flags().StringP("user", "U", "", "Create a personal access token. For the current user, use @me.") + tokenCmd.AddCommand(token_createCmd) + + carapace.Gen(token_createCmd).FlagCompletion(carapace.ActionMap{ + "access-level": carapace.ActionValues("guest", "reporter", "developer", "maintainer", "owner"), + "group": action.ActionGroups(token_createCmd), + "output": carapace.ActionValues("text", "json"), + // TODO scope + "user": action.ActionUsers(token_createCmd), + }) +} diff --git a/completers/glab_completer/cmd/user.go b/completers/glab_completer/cmd/user.go index 406c977ee8..99b28515f3 100644 --- a/completers/glab_completer/cmd/user.go +++ b/completers/glab_completer/cmd/user.go @@ -7,7 +7,7 @@ import ( var userCmd = &cobra.Command{ Use: "user [flags]", - Short: "Interact with user", + Short: "Interact with a GitLab user account.", Run: func(cmd *cobra.Command, args []string) {}, } diff --git a/completers/glab_completer/cmd/user_events.go b/completers/glab_completer/cmd/user_events.go index b2f7b28ff0..f630750c2d 100644 --- a/completers/glab_completer/cmd/user_events.go +++ b/completers/glab_completer/cmd/user_events.go @@ -7,15 +7,20 @@ import ( var user_eventsCmd = &cobra.Command{ Use: "events", - Short: "View user events", + Short: "View user events.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(user_eventsCmd).Standalone() - user_eventsCmd.Flags().BoolP("all", "a", false, "Get events from all projects") - user_eventsCmd.Flags().StringP("page", "p", "", "Page number") - user_eventsCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page") + user_eventsCmd.Flags().BoolP("all", "a", false, "Get events from all projects.") + user_eventsCmd.Flags().StringP("output", "F", "", "Format output as: 'text', 'json'.") + user_eventsCmd.Flags().StringP("page", "p", "", "Page number.") + user_eventsCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") userCmd.AddCommand(user_eventsCmd) + + carapace.Gen(user_eventsCmd).FlagCompletion(carapace.ActionMap{ + "output": carapace.ActionValues("text", "json"), + }) } diff --git a/completers/glab_completer/cmd/variable.go b/completers/glab_completer/cmd/variable.go index a338754ec0..5ff9850d0a 100644 --- a/completers/glab_completer/cmd/variable.go +++ b/completers/glab_completer/cmd/variable.go @@ -8,7 +8,7 @@ import ( var variableCmd = &cobra.Command{ Use: "variable", - Short: "Manage GitLab Project and Group Variables", + Short: "Manage variables for a GitLab project or group.", Aliases: []string{"var"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,7 +16,7 @@ var variableCmd = &cobra.Command{ func init() { carapace.Gen(variableCmd).Standalone() - variableCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + variableCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") rootCmd.AddCommand(variableCmd) carapace.Gen(variableCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/variable_delete.go b/completers/glab_completer/cmd/variable_delete.go index 1a94b1ceb1..e775eed453 100644 --- a/completers/glab_completer/cmd/variable_delete.go +++ b/completers/glab_completer/cmd/variable_delete.go @@ -8,7 +8,7 @@ import ( var variable_deleteCmd = &cobra.Command{ Use: "delete ", - Short: "Delete a project or group variable", + Short: "Delete a variable for a project or group.", Aliases: []string{"remove"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,8 +16,8 @@ var variable_deleteCmd = &cobra.Command{ func init() { carapace.Gen(variable_deleteCmd).Standalone() - variable_deleteCmd.Flags().StringP("group", "g", "", "Delete variable from a group") - variable_deleteCmd.Flags().StringP("scope", "s", "", "The environment_scope of the variable. All (*), or specific environments") + variable_deleteCmd.Flags().StringP("group", "g", "", "Delete variable from a group.") + variable_deleteCmd.Flags().StringP("scope", "s", "", "The 'environment_scope' of the variable. Options: all (*), or specific environments.") variableCmd.AddCommand(variable_deleteCmd) carapace.Gen(variable_deleteCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/variable_export.go b/completers/glab_completer/cmd/variable_export.go index 876b8fb6b5..01135f09f7 100644 --- a/completers/glab_completer/cmd/variable_export.go +++ b/completers/glab_completer/cmd/variable_export.go @@ -8,7 +8,7 @@ import ( var variable_exportCmd = &cobra.Command{ Use: "export", - Short: "Export project or group variables.", + Short: "Export variables from a project or group.", Aliases: []string{"ex"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -19,7 +19,7 @@ func init() { variable_exportCmd.PersistentFlags().StringP("group", "g", "", "Select a group or subgroup. Ignored if a repository argument is set.") variable_exportCmd.Flags().StringP("page", "p", "", "Page number.") variable_exportCmd.Flags().StringP("per-page", "P", "", "Number of items to list per page.") - variable_exportCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + variable_exportCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") variableCmd.AddCommand(variable_exportCmd) carapace.Gen(variable_exportCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/variable_get.go b/completers/glab_completer/cmd/variable_get.go index 1ddf6fa9ab..1a7177ac93 100644 --- a/completers/glab_completer/cmd/variable_get.go +++ b/completers/glab_completer/cmd/variable_get.go @@ -8,15 +8,16 @@ import ( var variable_getCmd = &cobra.Command{ Use: "get ", - Short: "get a project or group variable", + Short: "Get a variable for a project or group.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(variable_getCmd).Standalone() - variable_getCmd.Flags().StringP("group", "g", "", "Get variable for a group") - variable_getCmd.Flags().StringP("scope", "s", "", "The environment_scope of the variable. All (*), or specific environments.") + variable_getCmd.Flags().StringP("group", "g", "", "Get variable for a group.") + variable_getCmd.Flags().StringP("output", "F", "", "Format output as: text, json.") + variable_getCmd.Flags().StringP("scope", "s", "", "The environment_scope of the variable. Values: all (*), or specific environments.") variableCmd.AddCommand(variable_getCmd) carapace.Gen(variable_getCmd).FlagCompletion(carapace.ActionMap{ @@ -26,4 +27,8 @@ func init() { action.ActionEnvironments(variable_getCmd), ).ToA(), }) + + carapace.Gen(variable_getCmd).PositionalCompletion( + action.ActionVariables(variable_getCmd), + ) } diff --git a/completers/glab_completer/cmd/variable_list.go b/completers/glab_completer/cmd/variable_list.go index 50fb7dc683..069225154f 100644 --- a/completers/glab_completer/cmd/variable_list.go +++ b/completers/glab_completer/cmd/variable_list.go @@ -8,7 +8,7 @@ import ( var variable_listCmd = &cobra.Command{ Use: "list", - Short: "List project or group variables", + Short: "List variables for a project or group.", Aliases: []string{"ls"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,8 +16,9 @@ var variable_listCmd = &cobra.Command{ func init() { carapace.Gen(variable_listCmd).Standalone() - variable_listCmd.PersistentFlags().StringP("group", "g", "", "Select a group/subgroup. This option is ignored if a repo argument is set.") - variable_listCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository using the `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format or full URL or git URL") + variable_listCmd.PersistentFlags().StringP("group", "g", "", "Select a group or subgroup. Ignored if a repository argument is set.") + variable_listCmd.Flags().StringP("output", "F", "", "Format output as: text, json.") + variable_listCmd.PersistentFlags().StringP("repo", "R", "", "Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.") variableCmd.AddCommand(variable_listCmd) carapace.Gen(variable_listCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/variable_set.go b/completers/glab_completer/cmd/variable_set.go index 8a25bbed87..c1f2d22677 100644 --- a/completers/glab_completer/cmd/variable_set.go +++ b/completers/glab_completer/cmd/variable_set.go @@ -8,7 +8,7 @@ import ( var variable_setCmd = &cobra.Command{ Use: "set ", - Short: "Create a new project or group variable", + Short: "Create a new variable for a project or group.", Aliases: []string{"new", "create"}, Run: func(cmd *cobra.Command, args []string) {}, } @@ -16,12 +16,13 @@ var variable_setCmd = &cobra.Command{ func init() { carapace.Gen(variable_setCmd).Standalone() - variable_setCmd.Flags().StringP("group", "g", "", "Set variable for a group") - variable_setCmd.Flags().BoolP("masked", "m", false, "Whether the variable is masked") - variable_setCmd.Flags().BoolP("protected", "p", false, "Whether the variable is protected") - variable_setCmd.Flags().StringP("scope", "s", "", "The environment_scope of the variable. All (*), or specific environments") - variable_setCmd.Flags().StringP("type", "t", "", "The type of a variable: {env_var|file}") - variable_setCmd.Flags().StringP("value", "v", "", "The value of a variable") + variable_setCmd.Flags().StringP("group", "g", "", "Set variable for a group.") + variable_setCmd.Flags().BoolP("masked", "m", false, "Whether the variable is masked.") + variable_setCmd.Flags().BoolP("protected", "p", false, "Whether the variable is protected.") + variable_setCmd.Flags().BoolP("raw", "r", false, "Whether the variable is treated as a raw string.") + variable_setCmd.Flags().StringP("scope", "s", "", "The environment_scope of the variable. Values: all (*), or specific environments.") + variable_setCmd.Flags().StringP("type", "t", "", "The type of a variable: env_var, file.") + variable_setCmd.Flags().StringP("value", "v", "", "The value of a variable.") variableCmd.AddCommand(variable_setCmd) carapace.Gen(variable_setCmd).FlagCompletion(carapace.ActionMap{ @@ -36,6 +37,6 @@ func init() { }) carapace.Gen(variable_setCmd).PositionalCompletion( - action.ActionVariables(variableCmd), + action.ActionVariables(variable_setCmd), ) } diff --git a/completers/glab_completer/cmd/variable_update.go b/completers/glab_completer/cmd/variable_update.go index d659130da0..f5c1b43ffe 100644 --- a/completers/glab_completer/cmd/variable_update.go +++ b/completers/glab_completer/cmd/variable_update.go @@ -8,19 +8,20 @@ import ( var variable_updateCmd = &cobra.Command{ Use: "update ", - Short: "Update an existing project or group variable", + Short: "Update an existing variable for a project or group.", Run: func(cmd *cobra.Command, args []string) {}, } func init() { carapace.Gen(variable_updateCmd).Standalone() - variable_updateCmd.Flags().StringP("group", "g", "", "Set variable for a group") - variable_updateCmd.Flags().BoolP("masked", "m", false, "Whether the variable is masked") - variable_updateCmd.Flags().BoolP("protected", "p", false, "Whether the variable is protected") - variable_updateCmd.Flags().StringP("scope", "s", "", "The environment_scope of the variable. All (*), or specific environments") - variable_updateCmd.Flags().StringP("type", "t", "", "The type of a variable: {env_var|file}") - variable_updateCmd.Flags().StringP("value", "v", "", "The value of a variable") + variable_updateCmd.Flags().StringP("group", "g", "", "Set variable for a group.") + variable_updateCmd.Flags().BoolP("masked", "m", false, "Whether the variable is masked.") + variable_updateCmd.Flags().BoolP("protected", "p", false, "Whether the variable is protected.") + variable_updateCmd.Flags().BoolP("raw", "r", false, "Whether the variable is treated as a raw string.") + variable_updateCmd.Flags().StringP("scope", "s", "", "The environment_scope of the variable. Values: all (*), or specific environments.") + variable_updateCmd.Flags().StringP("type", "t", "", "The type of a variable: env_var, file.") + variable_updateCmd.Flags().StringP("value", "v", "", "The value of a variable.") variableCmd.AddCommand(variable_updateCmd) carapace.Gen(variable_updateCmd).FlagCompletion(carapace.ActionMap{ diff --git a/completers/glab_completer/cmd/version.go b/completers/glab_completer/cmd/version.go index e7259fe8b9..9bd1ee4932 100644 --- a/completers/glab_completer/cmd/version.go +++ b/completers/glab_completer/cmd/version.go @@ -7,7 +7,7 @@ import ( var versionCmd = &cobra.Command{ Use: "version", - Short: "Show glab version information", + Short: "Show version information for glab.", Aliases: []string{"v"}, Run: func(cmd *cobra.Command, args []string) {}, }