Skip to content

Commit

Permalink
Fix completion. (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Mar 20, 2024
1 parent 25aea4f commit beeb40a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions cmd/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ type Completion struct {
cloud *client.CloudAPI
}

func NewCompletion(cloud *client.CloudAPI) *Completion {
return &Completion{
cloud: cloud,
}
func (c *Completion) SetClient(client *client.CloudAPI) {
c.cloud = client
}

func (c *Completion) ContextListCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func initConfigWithViperCtx(cfg *config) error {
}

cfg.cloud = cloud
cfg.comp = completion.NewCompletion(cloud)
cfg.comp.SetClient(cloud)

parsedURL, err := url.Parse(driverURL)
if err != nil {
Expand Down

0 comments on commit beeb40a

Please sign in to comment.