Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone committed Apr 22, 2020
1 parent 4f30e15 commit 85075ce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/namespaces/object/v1/custom_config_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func configGetCommand() *core.Command {
Name: "type",
Short: "Type of S3 tool you want to generate a config for",
Required: true,
EnumValues: []string{rclone.String(), s3cmd.String(), mc.String()},
EnumValues: supportedTools.ToStringArray(),
},
{
Name: "name",
Expand Down
2 changes: 1 addition & 1 deletion internal/namespaces/object/v1/custom_config_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func configInstallCommand() *core.Command {
Name: "type",
Short: "Type of S3 tool you want to generate a config for",
Required: true,
EnumValues: []string{rclone.String(), s3cmd.String(), mc.String()},
EnumValues: supportedTools.ToStringArray(),
},
{
Name: "name",
Expand Down
12 changes: 11 additions & 1 deletion internal/namespaces/object/v1/s3configfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ func (c s3tool) String() string {
return string(c)
}

type SupportedTool []s3tool

func (s SupportedTool) ToStringArray() []string {
var res []string
for _, x := range s {
res = append(res, x.String())
}
return res
}

type s3config struct {
AccessKey string
SecretKey string
Expand All @@ -32,7 +42,7 @@ const (
mc = s3tool("mc")
)

var supportedTools = []s3tool{
var supportedTools = SupportedTool{
rclone,
s3cmd,
mc,
Expand Down

0 comments on commit 85075ce

Please sign in to comment.