@@ -38,13 +38,18 @@ var pullCmd = &cobra.Command{
3838 SilenceUsage : true ,
3939 FParseErrWhitelist : cobra.FParseErrWhitelist {UnknownFlags : true },
4040 RunE : func (cmd * cobra.Command , args []string ) error {
41+ if err := pullConfig .Validate (); err != nil {
42+ return err
43+ }
44+
4145 return runPull (context .Background (), args [0 ])
4246 },
4347}
4448
4549// init initializes pull command.
4650func init () {
4751 flags := pullCmd .Flags ()
52+ flags .IntVar (& pullConfig .Concurrency , "concurrency" , pullConfig .Concurrency , "specify the number of concurrent pull operations (default: 3)" )
4853 flags .BoolVar (& pullConfig .PlainHTTP , "plain-http" , false , "use plain HTTP instead of HTTPS" )
4954 flags .BoolVar (& pullConfig .Insecure , "insecure" , false , "use insecure connection for the pull operation and skip TLS verification" )
5055 flags .StringVar (& pullConfig .Proxy , "proxy" , "" , "use proxy for the pull operation" )
@@ -66,9 +71,10 @@ func runPull(ctx context.Context, target string) error {
6671 return fmt .Errorf ("target is required" )
6772 }
6873
69- opts := []backend.Option {backend .WithInsecure (pullConfig .Insecure )}
70- if pullConfig .PlainHTTP {
71- opts = append (opts , backend .WithPlainHTTP ())
74+ opts := []backend.Option {
75+ backend .WithInsecure (pullConfig .Insecure ),
76+ backend .WithPlainHTTP (pullConfig .PlainHTTP ),
77+ backend .WithConcurrency (pullConfig .Concurrency ),
7278 }
7379
7480 if pullConfig .Proxy != "" {
0 commit comments