mirror of https://gitlab.com/gitlab-org/cli.git
feat(ci): add --scope and --source flags for list command
This commit is contained in:
parent
58fcedb941
commit
2b6a50508b
|
@ -41,10 +41,16 @@ func NewCmdList(f *cmdutils.Factory) *cobra.Command {
|
|||
l.Page = 1
|
||||
l.PerPage = 30
|
||||
|
||||
if m, _ := cmd.Flags().GetString("scope"); m != "" {
|
||||
l.Scope = gitlab.String(m)
|
||||
}
|
||||
if m, _ := cmd.Flags().GetString("status"); m != "" {
|
||||
l.Status = gitlab.BuildState(gitlab.BuildStateValue(m))
|
||||
titleQualifier = m
|
||||
}
|
||||
if m, _ := cmd.Flags().GetString("source"); m != "" {
|
||||
l.Source = gitlab.String(m)
|
||||
}
|
||||
if m, _ := cmd.Flags().GetString("orderBy"); m != "" {
|
||||
l.OrderBy = gitlab.String(m)
|
||||
}
|
||||
|
@ -72,7 +78,9 @@ func NewCmdList(f *cmdutils.Factory) *cobra.Command {
|
|||
return nil
|
||||
},
|
||||
}
|
||||
pipelineListCmd.Flags().StringP("scope", "", "", "Get pipeline by scope: {running|pending|finished|branches|tags}")
|
||||
pipelineListCmd.Flags().StringP("status", "s", "", "Get pipeline with status: {running|pending|success|failed|canceled|skipped|created|manual}")
|
||||
pipelineListCmd.Flags().StringP("source", "", "", "Get pipeline from source: {push|web|trigger|schedule|api|external|pipeline|chat|webide|merge_request_event|external_pull_request_event|parent_pipeline|ondemand_dast_scan|ondemand_dast_validation}")
|
||||
pipelineListCmd.Flags().StringP("orderBy", "o", "", "Order pipeline by <string>")
|
||||
pipelineListCmd.Flags().StringP("sort", "", "desc", "Sort pipeline by {asc|desc}. (Defaults to desc)")
|
||||
pipelineListCmd.Flags().IntP("page", "p", 1, "Page number")
|
||||
|
|
|
@ -31,7 +31,9 @@ glab ci list --status=failed
|
|||
-o, --orderBy string Order pipeline by <string>
|
||||
-p, --page int Page number (default 1)
|
||||
-P, --per-page int Number of items to list per page. (default 30) (default 30)
|
||||
--scope string Get pipeline by scope: {running|pending|finished|branches|tags}
|
||||
--sort string Sort pipeline by {asc|desc}. (Defaults to desc) (default "desc")
|
||||
--source string Get pipeline from source: {push|web|trigger|schedule|api|external|pipeline|chat|webide|merge_request_event|external_pull_request_event|parent_pipeline|ondemand_dast_scan|ondemand_dast_validation}
|
||||
-s, --status string Get pipeline with status: {running|pending|success|failed|canceled|skipped|created|manual}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue