@@ -32,12 +32,13 @@ func NewRoot() (cmd *cobra.Command) {
3232 flags .StringVarP (& opt .Output , "output" , "o" , "" , "Write output to <file> instead of stdout." )
3333 flags .BoolVarP (& opt .ShowProgress , "show-progress" , "" , true , "If show the progress of download" )
3434 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` )
3637 flags .BoolVarP (& opt .KeepPart , "keep-part" , "" , false ,
3738 "If you want to keep the part files instead of deleting them" )
3839 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" )
4142
4243 cmd .AddCommand (
4344 getCmd ,
@@ -115,14 +116,6 @@ func (o *downloadOption) preRunE(cmd *cobra.Command, args []string) (err error)
115116 return fmt .Errorf ("no URL provided" )
116117 }
117118
118- if o .OS == "" {
119- o .OS = runtime .GOOS
120- }
121-
122- if o .Arch == "" {
123- o .Arch = runtime .GOARCH
124- }
125-
126119 targetURL := args [0 ]
127120 if ! strings .HasPrefix (targetURL , "http://" ) && ! strings .HasPrefix (targetURL , "https://" ) {
128121 if targetURL , err = o .providerURLParse (targetURL ); err != nil {
0 commit comments