diff --git a/lxc/image_alias.go b/lxc/image_alias.go index b0b0deeee57c..1a0d2a4a3a26 100644 --- a/lxc/image_alias.go +++ b/lxc/image_alias.go @@ -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 } @@ -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) + } + return cmd } @@ -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 }