Skip to content

Commit

Permalink
services shell completion bugfix
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Onyshchuk <andryk.rv@gmail.com>
  • Loading branch information
oandrew authored and ndeloof committed Mar 15, 2024
1 parent b2d4c1b commit f46ca45
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/compose/completion.go
Expand Up @@ -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
}
}

Expand Down

0 comments on commit f46ca45

Please sign in to comment.