Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Sep 25, 2023
1 parent a4bd80d commit a282d1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example/cmd/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ func init() {
compatCmd.RegisterFlagCompletionFunc("filterdirs-chdir", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"subdir"}, cobra.ShellCompDirectiveFilterDirs
})

compatCmd.RegisterFlagCompletionFunc("keeporder", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"one", "three", "two"}, cobra.ShellCompDirectiveKeepOrder
})
}
7 changes: 7 additions & 0 deletions example/cmd/compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,12 @@ func TestCompat(t *testing.T) {
Tag("directories").
StyleF(style.ForPathExt).
Usage("ShellCompDirectiveFilterDirs"))

s.Run("compat", "--keeporder", "").
Expect(carapace.ActionValues(
"one",
"two",
"three",
).Usage("ShellCompDirectiveKeepOrder"))
})
}

0 comments on commit a282d1e

Please sign in to comment.