gitlab-go/jobs/jobs.go

27 lines
861 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package jobs
import (
"github.com/urfave/cli/v2"
"github.com/xuxiaowei-com-cn/gitlab-go/flag"
)
const (
ScopeValue = ""
ScopeUsage = "要显示的作业范围。以下之一或数组created、pending、running、failed、success、canceled、skipped、waiting_for_resource 或 manual。范围如果未提供则返回所有作业。"
)
// Jobs 作业 API https://docs.gitlab.cn/jh/api/jobs.html
func Jobs() *cli.Command {
return &cli.Command{
Name: "job",
Aliases: []string{"jobs", "j"},
Usage: "作业 API中文文档https://docs.gitlab.cn/jh/api/jobs.html",
Flags: append(flag.Common(), flag.Page(), flag.PerPage(), flag.PrintJson(), flag.PrintTime(), flag.Recursion(),
flag.Sort(), flag.Id(false), flag.JobIdRange(false), flag.Scope(ScopeValue, ScopeUsage)),
Subcommands: []*cli.Command{
List(),
Erase(),
},
}
}