Improve shell completion for `--project-directory`

Signed-off-by: Ariel Bachar <relrelb@users.noreply.github.com>
Signed-off-by: relrelb <relrelb@users.noreply.github.com>
This commit is contained in:
relrelb 2023-08-03 23:37:46 +03:00
parent 80856eacaf
commit 8a4095b507
1 changed files with 6 additions and 0 deletions

View File

@ -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) {