Skip to content

Commit 8bf7d98

Browse files
committed
refactor: refactor timeout flag to accept duration input
- Change the flag `timeout` to accept a duration instead of a string Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent cb6f2c7 commit 8bf7d98

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cmd
33
import (
44
"errors"
55
"strings"
6+
"time"
67

78
"github.com/appleboy/com/array"
89
"github.com/fatih/color"
@@ -35,7 +36,7 @@ func init() {
3536
configCmd.PersistentFlags().StringP("org_id", "o", "", "openai requesting organization")
3637
configCmd.PersistentFlags().StringP("proxy", "", "", "http proxy")
3738
configCmd.PersistentFlags().StringP("socks", "", "", "socks proxy")
38-
configCmd.PersistentFlags().StringP("timeout", "t", "10s", "http timeout")
39+
configCmd.PersistentFlags().DurationP("timeout", "t", 10*time.Second, "http timeout")
3940
configCmd.PersistentFlags().StringP("template_file", "", "", "git commit message file")
4041
configCmd.PersistentFlags().StringP("template_string", "", "", "git commit message string")
4142
configCmd.PersistentFlags().IntP("diff_unified", "", 3, "generate diffs with <n> lines of context, default is 3")

0 commit comments

Comments
 (0)