|
|
|
@ -180,6 +180,7 @@ func init() {
|
|
|
|
|
curlcmd.Flags().IntP("max-time", "m", 0, "最大传输超时时间")
|
|
|
|
|
curlcmd.Flags().Int("connect-timeout", 15, "最大连接建立超时时间")
|
|
|
|
|
curlcmd.Flags().StringP("user-agent", "A", "", "UA设置")
|
|
|
|
|
curlupcmd.Flags().StringP("address", "a", "", "远端ip:端口号")
|
|
|
|
|
curlcmd.AddCommand(curlupcmd)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -188,10 +189,11 @@ var curlupcmd = &cobra.Command{
|
|
|
|
|
Short: "victorique上传工具",
|
|
|
|
|
Long: "victorique上传工具",
|
|
|
|
|
Run: func(this *cobra.Command, args []string) {
|
|
|
|
|
if len(args) != 2 {
|
|
|
|
|
if len(args) != 1 {
|
|
|
|
|
fmt.Println(args, "不合法啊")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
a, _ := this.Flags().GetString("address")
|
|
|
|
|
curl := starainrt.NewStarCurl()
|
|
|
|
|
curl.TimeOut = 0
|
|
|
|
|
shell := func(pect float64) {
|
|
|
|
@ -201,7 +203,7 @@ var curlupcmd = &cobra.Command{
|
|
|
|
|
fmt.Printf("已完成:%f%%\r", pect)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
data, err := curl.CurlWithFile("http://"+args[0]+"/vtqeupload1127", nil, "victorique", args[1], "", false, shell)
|
|
|
|
|
data, err := curl.CurlWithFile("http://"+a+"/vtqeupload1127", nil, "victorique", args[0], "", false, shell)
|
|
|
|
|
fmt.Println(string(data))
|
|
|
|
|
if err != nil {
|
|
|
|
|
fmt.Println(err)
|
|
|
|
|