Skip to content

Commit

Permalink
lxc/completion: Fix cmpRemotes
Browse files Browse the repository at this point in the history
This commit fixes the logic in `cmpRemotes` to ensure remotes are
contextually completed correctly based on the current remote.

Signed-off-by: Kadin Sayani <[email protected]>
  • Loading branch information
kadinsayani committed Dec 20, 2024
1 parent 5fbd3a7 commit 5e7a526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lxc/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ func (g *cmdGlobal) cmpRemotes(includeAll bool) ([]string, cobra.ShellCompDirect
results := make([]string, 0, len(g.conf.Remotes))

for remoteName, rc := range g.conf.Remotes {
if remoteName == "local" || (!includeAll && rc.Protocol != "lxd" && rc.Protocol != "") {
if remoteName == "local" && g.conf.DefaultRemote == "local" || remoteName == g.conf.DefaultRemote || (!includeAll && rc.Protocol != "lxd" && rc.Protocol != "") {
continue
}

Expand Down

0 comments on commit 5e7a526

Please sign in to comment.