services shell completion bugfix

Signed-off-by: Andrew Onyshchuk <[email protected]>
This commit is contained in:
Andrew Onyshchuk
2024-03-15 10:47:30 +01:00
committed by Nicolas De loof
parent b2d4c1b865
commit f46ca459d2
+3 -2
View File
@@ -41,13 +41,14 @@ func completeServiceNames(dockerCli command.Cli, p *ProjectOptions) validArgsFn
if err != nil {
return nil, cobra.ShellCompDirectiveNoFileComp
}
var values []string
serviceNames := append(project.ServiceNames(), project.DisabledServiceNames()...)
for _, s := range serviceNames {
if toComplete == "" || strings.HasPrefix(s, toComplete) {
serviceNames = append(serviceNames, s)
values = append(values, s)
}
}
return serviceNames, cobra.ShellCompDirectiveNoFileComp
return values, cobra.ShellCompDirectiveNoFileComp
}
}