Skip to content

Commit ad0a391

Browse files
authored
fix: network list --zone completion (#367)
1 parent e652ab5 commit ad0a391

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/commands/network/list.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package network
22

33
import (
44
"github.com/UpCloudLtd/upcloud-cli/v3/internal/commands"
5+
"github.com/UpCloudLtd/upcloud-cli/v3/internal/completion"
56
"github.com/UpCloudLtd/upcloud-cli/v3/internal/config"
7+
"github.com/UpCloudLtd/upcloud-cli/v3/internal/namedargs"
68
"github.com/UpCloudLtd/upcloud-cli/v3/internal/output"
79
"github.com/UpCloudLtd/upcloud-cli/v3/internal/ui"
810

@@ -50,6 +52,10 @@ func (s *listCommand) InitCommand() {
5052
s.AddFlags(flags)
5153
}
5254

55+
func (s *listCommand) InitCommandWithConfig(cfg *config.Config) {
56+
commands.Must(s.Cobra().RegisterFlagCompletionFunc("zone", namedargs.CompletionFunc(completion.Zone{}, cfg)))
57+
}
58+
5359
// ExecuteWithoutArguments implements commands.NoArgumentCommand
5460
func (s *listCommand) ExecuteWithoutArguments(exec commands.Executor) (output.Output, error) {
5561
svc := exec.Network()

0 commit comments

Comments
 (0)