未验证 提交 53fcebb3 编写于 作者: LinuxSuRen's avatar LinuxSuRen 提交者: GitHub

Add a global timeout option for all commands (#446)

上级 fcf0d11a
......@@ -24,7 +24,8 @@ func init() {
}
var queueCancelCmd = &cobra.Command{
Use: "cancel <id>",
Use: "cancel",
Example: "jcli queue cancel 234",
Short: i18n.T("Cancel the queue items of your Jenkins"),
Long: i18n.T("Cancel the queue items of your Jenkins"),
Args: cobra.MinimumNArgs(1),
......
......@@ -43,6 +43,7 @@ type RootOptions struct {
Proxy string
ProxyAuth string
ProxyDisable bool
Timeout int64
Doctor bool
StartTime time.Time
......@@ -191,6 +192,8 @@ func init() {
i18n.T("The auth of proxy of connection to Jenkins"))
rootCmd.PersistentFlags().BoolVarP(&rootOptions.ProxyDisable, "proxy-disable", "", false,
i18n.T("Disable proxy setting"))
rootCmd.PersistentFlags().Int64VarP(&rootOptions.Timeout, "timeout", "", 30,
"Timeout in second setting for http request")
rootCmd.SetOut(os.Stdout)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册