Skip to content

Commit 2b520b9

Browse files
authored
feat(ipfs): enable commands (#2762)
1 parent 4662c64 commit 2b520b9

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

internal/namespaces/get_commands.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package namespaces
22

33
import (
4+
"os"
5+
46
"github.com/scaleway/scaleway-cli/v2/internal/core"
57
accountv2 "github.com/scaleway/scaleway-cli/v2/internal/namespaces/account/v2"
68
account "github.com/scaleway/scaleway-cli/v2/internal/namespaces/account/v2alpha1"
@@ -19,6 +21,7 @@ import (
1921
initNamespace "github.com/scaleway/scaleway-cli/v2/internal/namespaces/init"
2022
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/instance/v1"
2123
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/iot/v1"
24+
ipfs "github.com/scaleway/scaleway-cli/v2/internal/namespaces/ipfs/v1alpha1"
2225
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/k8s/v1"
2326
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/lb/v1"
2427
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/marketplace/v2"
@@ -34,6 +37,8 @@ import (
3437
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpcgw/v1"
3538
)
3639

40+
var labs = os.Getenv("SCW_LABS") == "true"
41+
3742
// GetCommands returns a list of all commands in the CLI.
3843
// It is used by both scw and scw-qa.
3944
// We can not put it in `core` package as it would result in a import cycle `core` -> `namespaces/autocomplete` -> `core`.
@@ -72,6 +77,9 @@ func GetCommands(beta ...bool) *core.Commands {
7277
tem.GetCommands(),
7378
mnq.GetCommands(),
7479
)
80+
if labs {
81+
commands.Merge(ipfs.GetCommands())
82+
}
7583

7684
return commands
7785
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package ipfs
2+
3+
import (
4+
"github.com/scaleway/scaleway-cli/v2/internal/core"
5+
)
6+
7+
// GetCommands returns the list of commands for the 'ipfs' namespace.
8+
func GetCommands() *core.Commands {
9+
cmds := GetGeneratedCommands()
10+
11+
return cmds
12+
}

internal/namespaces/ipfs/v1alpha1/ipfs_cli.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ package ipfs
55

66
import (
77
"context"
8-
"reflect"
9-
108
"github.com/scaleway/scaleway-cli/v2/internal/core"
119
"github.com/scaleway/scaleway-sdk-go/api/ipfs/v1alpha1"
1210
"github.com/scaleway/scaleway-sdk-go/scw"
11+
12+
"reflect"
1313
)
1414

1515
// always import dependencies

0 commit comments

Comments
 (0)