浏览代码

Improve shell completion for `--project-directory`

Signed-off-by: Ariel Bachar <[email protected]>
Signed-off-by: relrelb <[email protected]>
relrelb 2 年之前
父节点
当前提交
8a4095b507
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      cmd/compose/compose.go

+ 6 - 0
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) {