Skip to content

Commit abfb97f

Browse files
committed
add support in beta version
1 parent 774e36e commit abfb97f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

commands/commands.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package commands
22

33
import (
4-
file "github.com/scaleway/scaleway-cli/v2/internal/namespaces/file/v1alpha1"
54
"os"
65

76
"github.com/scaleway/scaleway-cli/v2/core"
@@ -21,6 +20,7 @@ import (
2120
domain "github.com/scaleway/scaleway-cli/v2/internal/namespaces/domain/v2beta1"
2221
edgeservices "github.com/scaleway/scaleway-cli/v2/internal/namespaces/edge_services/v1beta1"
2322
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/feedback"
23+
file "github.com/scaleway/scaleway-cli/v2/internal/namespaces/file/v1alpha1"
2424
flexibleip "github.com/scaleway/scaleway-cli/v2/internal/namespaces/flexibleip/v1alpha1"
2525
function "github.com/scaleway/scaleway-cli/v2/internal/namespaces/function/v1beta1"
2626
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/help"
@@ -113,11 +113,13 @@ func GetCommands() *core.Commands {
113113
mongodb.GetCommands(),
114114
audit_trail.GetCommands(),
115115
interlink.GetCommands(),
116-
file.GetCommands(),
117116
)
118117

119118
if beta {
120-
commands.Merge(dedibox.GetCommands())
119+
commands.MergeAll(
120+
dedibox.GetCommands(),
121+
file.GetCommands(),
122+
)
121123
}
122124

123125
return commands

core/command.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ func (c *Commands) Merge(cmds *Commands) {
291291
}
292292
}
293293

294+
func (c *Commands) MergeAll(cmds ...*Commands) {
295+
for _, command := range cmds {
296+
c.Merge(command)
297+
}
298+
}
299+
294300
func (c *Commands) GetAll() []*Command {
295301
return c.commands
296302
}

0 commit comments

Comments
 (0)