Skip to content

Commit

Permalink
lxc/completion: Add completions for lxc image alias list|delete|rename
Browse files Browse the repository at this point in the history
Signed-off-by: Kadin Sayani <[email protected]>
  • Loading branch information
kadinsayani committed Jan 7, 2025
1 parent 1e0ed31 commit 9c1dede
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lxc/image_alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ func (c *cmdImageAliasDelete) command() *cobra.Command {

cmd.RunE = c.run

cmd.ValidArgsFunction = func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) > 0 {
return nil, cobra.ShellCompDirectiveNoFileComp
}

return c.global.cmpImages(toComplete)
}

return cmd
}

Expand Down Expand Up @@ -175,6 +183,14 @@ Filters may be part of the image hash or part of the image alias name.

cmd.RunE = c.run

cmd.ValidArgsFunction = func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) > 0 {
return nil, cobra.ShellCompDirectiveNoFileComp
}

return c.global.cmpRemotes(toComplete, true)

Check failure on line 191 in lxc/image_alias.go

View workflow job for this annotation

GitHub Actions / Documentation

too many arguments in call to c.global.cmpRemotes

Check failure on line 191 in lxc/image_alias.go

View workflow job for this annotation

GitHub Actions / Client (ubuntu-latest)

too many arguments in call to c.global.cmpRemotes

Check failure on line 191 in lxc/image_alias.go

View workflow job for this annotation

GitHub Actions / Client (macos-latest)

too many arguments in call to c.global.cmpRemotes

Check failure on line 191 in lxc/image_alias.go

View workflow job for this annotation

GitHub Actions / Client (windows-latest)

too many arguments in call to c.global.cmpRemotes

Check failure on line 191 in lxc/image_alias.go

View workflow job for this annotation

GitHub Actions / Code

too many arguments in call to c.global.cmpRemotes
}

return cmd
}

Expand Down Expand Up @@ -274,6 +290,14 @@ func (c *cmdImageAliasRename) command() *cobra.Command {

cmd.RunE = c.run

cmd.ValidArgsFunction = func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if len(args) > 0 {
return nil, cobra.ShellCompDirectiveNoFileComp
}

return c.global.cmpImages(toComplete)
}

return cmd
}

Expand Down

0 comments on commit 9c1dede

Please sign in to comment.