Skip to content

Commit

Permalink
Merge 77bbb43 into 725f354
Browse files Browse the repository at this point in the history
  • Loading branch information
nobjohns committed Jun 13, 2018
2 parents 725f354 + 77bbb43 commit e461a3a
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/command.go
Expand Up @@ -281,6 +281,7 @@ func (cmd *Command) ossClient(bucket string) (*oss.Client, error) {
accessKeySecret, _ := GetString(OptionAccessKeySecret, cmd.options)
stsToken, _ := GetString(OptionSTSToken, cmd.options)
disableCRC64, _ := GetBool(OptionDisableCRC64, cmd.options)
proxy, _ := GetString(OptionProxy, cmd.options)
if err := cmd.checkCredentials(endpoint, accessKeyID, accessKeySecret); err != nil {
return nil, err
}
Expand All @@ -290,6 +291,9 @@ func (cmd *Command) ossClient(bucket string) (*oss.Client, error) {
} else {
options = append(options, oss.EnableCRC(true))
}
if len(proxy) != 0 {
options = append(options, oss.Proxy(proxy))
}
client, err := oss.New(endpoint, accessKeyID, accessKeySecret, options...)
if err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions lib/config.go
Expand Up @@ -303,6 +303,7 @@ var configCommand = ConfigCommand{
OptionSTSToken,
OptionOutputDir,
OptionLanguage,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/const.go
Expand Up @@ -45,6 +45,7 @@ const (
OptionInclude = "include"
OptionExclude = "exclude"
OptionMeta = "meta"
OptionProxy = "proxyHost"
)

// the elements show in stat object
Expand Down
1 change: 1 addition & 0 deletions lib/cp.go
Expand Up @@ -1129,6 +1129,7 @@ var copyCommand = CopyCommand{
OptionParallel,
OptionSnapshotPath,
OptionDisableCRC64,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/create_symlink.go
Expand Up @@ -104,6 +104,7 @@ var createSymlinkCommand = CreateSymlinkCommand{
OptionAccessKeySecret,
OptionSTSToken,
OptionRetryTimes,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/ls.go
Expand Up @@ -346,6 +346,7 @@ var listCommand = ListCommand{
OptionAccessKeySecret,
OptionSTSToken,
OptionRetryTimes,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/mb.go
Expand Up @@ -149,6 +149,7 @@ var makeBucketCommand = MakeBucketCommand{
OptionSTSToken,
OptionRetryTimes,
OptionLanguage,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/option.go
Expand Up @@ -107,6 +107,7 @@ var OptionMap = map[string]Option{
OptionHashType: Option{"", "--type", DefaultHashType, OptionTypeAlternative, fmt.Sprintf("%s/%s", DefaultHashType, MD5HashType), "", fmt.Sprintf("计算的类型, 默认值:%s, 取值范围: %s/%s", DefaultHashType, DefaultHashType, MD5HashType),
fmt.Sprintf("hash type, Default: %s, value range is: %s/%s", DefaultHashType, DefaultHashType, MD5HashType)},
OptionVersion: Option{"-v", "--version", "", OptionTypeFlagTrue, "", "", fmt.Sprintf("显示ossutil的版本(%s)并退出。", Version), fmt.Sprintf("Show ossutil version (%s) and exit.", Version)},
OptionProxy: Option{"-x", "--proxy", "", OptionTypeString, "", "", "代理主机访问oss。", "Proxy host to access oss."},
}

func (T *Option) getHelp(language string) string {
Expand Down
1 change: 1 addition & 0 deletions lib/read_symlink.go
Expand Up @@ -100,6 +100,7 @@ var readSymlinkCommand = ReadSymlinkCommand{
OptionAccessKeySecret,
OptionSTSToken,
OptionRetryTimes,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/restore.go
Expand Up @@ -149,6 +149,7 @@ var restoreCommand = RestoreCommand{
OptionRetryTimes,
OptionRoutines,
OptionOutputDir,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/rm.go
Expand Up @@ -259,6 +259,7 @@ var removeCommand = RemoveCommand{
OptionAccessKeySecret,
OptionSTSToken,
OptionRetryTimes,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/set_acl.go
Expand Up @@ -239,6 +239,7 @@ var setACLCommand = SetACLCommand{
OptionRetryTimes,
OptionRoutines,
OptionOutputDir,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/set_meta.go
Expand Up @@ -280,6 +280,7 @@ var setMetaCommand = SetMetaCommand{
OptionRoutines,
OptionLanguage,
OptionOutputDir,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/signurl.go
Expand Up @@ -93,6 +93,7 @@ var signURLCommand = SignurlCommand{
OptionAccessKeyID,
OptionAccessKeySecret,
OptionSTSToken,
OptionProxy,
},
},
}
Expand Down
1 change: 1 addition & 0 deletions lib/stat.go
Expand Up @@ -100,6 +100,7 @@ var statCommand = StatCommand{
OptionAccessKeySecret,
OptionSTSToken,
OptionRetryTimes,
OptionProxy,
},
},
}
Expand Down

0 comments on commit e461a3a

Please sign in to comment.