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
4 changes: 4 additions & 0 deletions core/arg_specs.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ func (a *ArgSpec) ConflictWith(b *ArgSpec) bool {
(a.OneOfGroup == b.OneOfGroup)
}

func (a *ArgSpec) DebugString() string {
return a.Name
}

type DefaultFunc func(ctx context.Context) (value string, doc string)

func ZoneArgSpec(zones ...scw.Zone) *ArgSpec {
Expand Down
4 changes: 4 additions & 0 deletions core/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ func (node *AutoCompleteNode) GetChildMatch(name string) (*AutoCompleteNode, boo
return nil, false
}

func (node *AutoCompleteNode) DebugString() string {
return node.Name
}

func (node *AutoCompleteNode) addFlags(flags []FlagSpec) {
for i := range flags {
flag := &flags[i]
Expand Down
5 changes: 5 additions & 0 deletions core/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"net/http"
"os"
"strings"

"github.com/scaleway/scaleway-cli/v2/internal/account"
cliConfig "github.com/scaleway/scaleway-cli/v2/internal/config"
Expand Down Expand Up @@ -302,3 +303,7 @@ func Bootstrap(config *BootstrapConfig) (exitCode int, result any, err error) {

return 0, meta.result, nil
}

func (config *BootstrapConfig) DebugString() string {
return strings.Join(config.Args, " ")
}
4 changes: 4 additions & 0 deletions core/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ func (c *Command) Copy() *Command {
return &newCommand
}

func (c *Command) DebugString() string {
return c.getPath()
}

// get a signature to sort commands
func (c *Command) signature() string {
return c.Namespace + " " + c.Resource + " " + c.Verb + " " + c.Short
Expand Down
4 changes: 4 additions & 0 deletions core/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ type TestConfig struct {
EnableAliases bool
}

func (config *TestConfig) DebugString() string {
return config.Cmd
}

// getTestFilePath returns a valid filename path based on the go test name and suffix. (Take care of non fs friendly char)
func getTestFilePath(t *testing.T, suffix string) string {
t.Helper()
Expand Down
Loading