123
This commit is contained in:
@@ -3,7 +3,6 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"agent-wdd/log"
|
"agent-wdd/log"
|
||||||
"agent-wdd/utils"
|
"agent-wdd/utils"
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@@ -11,11 +10,13 @@ import (
|
|||||||
// 示例:添加download子命令
|
// 示例:添加download子命令
|
||||||
func addDownloadSubcommands(cmd *cobra.Command) {
|
func addDownloadSubcommands(cmd *cobra.Command) {
|
||||||
proxyCmd := &cobra.Command{
|
proxyCmd := &cobra.Command{
|
||||||
Use: "proxy [url] [dest]",
|
Use: "proxy [proxyUrl] [url] [dest]",
|
||||||
Short: "使用代理下载",
|
Short: "使用代理下载 支持socks5代理 http代理",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(3),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Printf("Downloading with proxy: %s -> %s\n", args[0], args[1])
|
// 判定参数是否正确
|
||||||
|
|
||||||
|
log.Info("Downloading using proxy: %s -> from %s to %s\n", args[0], args[1], args[2])
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user