This commit is contained in:
zeaslity
2025-02-27 14:52:57 +08:00
parent 3ad2533550
commit 6de29630b5

View File

@@ -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])
}, },
} }