Skip to content

Commit 5bbdf3d

Browse files
authored
Merge pull request docker#10879 from relrelb/project_directory_completion
Improve shell completion for `--project-directory`
2 parents 52103cc + 8a4095b commit 5bbdf3d

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)