Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions internal/namespaces/get_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ import (
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/shell"
tem "github.com/scaleway/scaleway-cli/v2/internal/namespaces/tem/v1alpha1"
versionNamespace "github.com/scaleway/scaleway-cli/v2/internal/namespaces/version"
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpc/v1"
vpcV1 "github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpc/v1"
vpcV2 "github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpc/v2"
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpcgw/v1"
webhosting "github.com/scaleway/scaleway-cli/v2/internal/namespaces/webhosting/v1alpha1"
"github.com/scaleway/scaleway-sdk-go/scw"
)

var labs = os.Getenv("SCW_ENABLE_LABS") == "true"

// Enable beta in the code when products are in beta
// var beta = os.Getenv(scw.ScwEnableBeta) == "true"
var beta = os.Getenv(scw.ScwEnableBeta) == "true"

// GetCommands returns a list of all commands in the CLI.
// It is used by both scw and scw-qa.
Expand Down Expand Up @@ -72,7 +74,7 @@ func GetCommands() *core.Commands {
lb.GetCommands(),
iot.GetCommands(),
help.GetCommands(),
vpc.GetCommands(),
vpcV1.GetCommands(),
domain.GetCommands(),
applesilicon.GetCommands(),
flexibleip.GetCommands(),
Expand All @@ -91,6 +93,9 @@ func GetCommands() *core.Commands {
if labs {
commands.Merge(ipfs.GetCommands())
}
if beta {
commands.Merge(vpcV2.GetCommands())
}

return commands
}
13 changes: 13 additions & 0 deletions internal/namespaces/vpc/v2/custom.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package vpc

import (
"github.com/scaleway/scaleway-cli/v2/internal/core"
)

func GetCommands() *core.Commands {
cmds := GetGeneratedCommands()
for _, cmd := range cmds.GetAll() {
cmd.Namespace = "vpc_v2"
}
return cmds
}