@@ -32,12 +32,13 @@ func NewRoot() (cmd *cobra.Command) {
32
32
flags .StringVarP (& opt .Output , "output" , "o" , "" , "Write output to <file> instead of stdout." )
33
33
flags .BoolVarP (& opt .ShowProgress , "show-progress" , "" , true , "If show the progress of download" )
34
34
flags .Int64VarP (& opt .ContinueAt , "continue-at" , "" , - 1 , "ContinueAt" )
35
- flags .IntVarP (& opt .Thread , "thread" , "" , 0 , "" )
35
+ flags .IntVarP (& opt .Thread , "thread" , "t" , 0 ,
36
+ `Download file with multi-threads. It only works when its value is bigger than 1` )
36
37
flags .BoolVarP (& opt .KeepPart , "keep-part" , "" , false ,
37
38
"If you want to keep the part files instead of deleting them" )
38
39
flags .StringVarP (& opt .Provider , "provider" , "" , ProviderGitHub , "The file provider" )
39
- flags .StringVarP (& opt .OS , "os" , "" , "" , "The OS of target binary file" )
40
- flags .StringVarP (& opt .Arch , "arch" , "" , "" , "The arch of target binary file" )
40
+ flags .StringVarP (& opt .OS , "os" , "" , runtime . GOOS , "The OS of target binary file" )
41
+ flags .StringVarP (& opt .Arch , "arch" , "" , runtime . GOARCH , "The arch of target binary file" )
41
42
42
43
cmd .AddCommand (
43
44
getCmd ,
@@ -115,14 +116,6 @@ func (o *downloadOption) preRunE(cmd *cobra.Command, args []string) (err error)
115
116
return fmt .Errorf ("no URL provided" )
116
117
}
117
118
118
- if o .OS == "" {
119
- o .OS = runtime .GOOS
120
- }
121
-
122
- if o .Arch == "" {
123
- o .Arch = runtime .GOARCH
124
- }
125
-
126
119
targetURL := args [0 ]
127
120
if ! strings .HasPrefix (targetURL , "http://" ) && ! strings .HasPrefix (targetURL , "https://" ) {
128
121
if targetURL , err = o .providerURLParse (targetURL ); err != nil {
0 commit comments