From 8a4095b507f62f63b5ebec7e29a45db69387f97e Mon Sep 17 00:00:00 2001 From: relrelb Date: Thu, 3 Aug 2023 23:37:46 +0300 Subject: [PATCH] Improve shell completion for `--project-directory` Signed-off-by: Ariel Bachar Signed-off-by: relrelb --- cmd/compose/compose.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/compose/compose.go b/cmd/compose/compose.go index d9a3c821a..e582739f3 100644 --- a/cmd/compose/compose.go +++ b/cmd/compose/compose.go @@ -442,6 +442,12 @@ func RootCommand(streams command.Cli, backend api.Service) *cobra.Command { //no "project-name", completeProjectNames(backend), ) + c.RegisterFlagCompletionFunc( //nolint:errcheck + "project-directory", + func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + return []string{}, cobra.ShellCompDirectiveFilterDirs + }, + ) c.RegisterFlagCompletionFunc( //nolint:errcheck "file", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {