Skip to content

Commit 8a4095b

Browse files
committed
Improve shell completion for --project-directory
Signed-off-by: Ariel Bachar <[email protected]> Signed-off-by: relrelb <[email protected]>
1 parent 80856ea commit 8a4095b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/compose/compose.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,12 @@ func RootCommand(streams command.Cli, backend api.Service) *cobra.Command { //no
442442
"project-name",
443443
completeProjectNames(backend),
444444
)
445+
c.RegisterFlagCompletionFunc( //nolint:errcheck
446+
"project-directory",
447+
func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
448+
return []string{}, cobra.ShellCompDirectiveFilterDirs
449+
},
450+
)
445451
c.RegisterFlagCompletionFunc( //nolint:errcheck
446452
"file",
447453
func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {

0 commit comments

Comments
 (0)