Skip to content

Commit 943f3a9

Browse files
authored
Merge pull request #3101 from carapace-sh/but-rub-branch
but: rub branches
2 parents b0ec6bb + cb0d681 commit 943f3a9

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

completers/common/but_completer/cmd/root.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ func init() {
5151
if util.HasPathPrefix(c.Args[0]) {
5252
return carapace.ActionValues()
5353
}
54-
return but.ActionCliIds(but.CliIdsOpts{Branches: true, Stacks: true})
54+
return carapace.Batch(
55+
but.ActionCliIds(but.CliIdsOpts{Branches: true, Stacks: true}),
56+
but.ActionLocalBranches(),
57+
).ToA().FilterArgs()
5558
}),
5659
)
5760

completers/common/but_completer/cmd/rub.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ func init() {
2020
rootCmd.AddCommand(rubCmd)
2121

2222
carapace.Gen(rubCmd).PositionalCompletion(
23-
but.ActionLocalBranches(),
24-
but.ActionLocalBranches().FilterArgs(),
23+
carapace.Batch(
24+
but.ActionCliIds(but.CliIdsOpts{}.Default()),
25+
but.ActionLocalBranches(),
26+
).ToA(),
27+
carapace.Batch(
28+
but.ActionCliIds(but.CliIdsOpts{Branches: true, Stacks: true}),
29+
but.ActionLocalBranches(),
30+
).ToA().FilterArgs(),
2531
)
2632
}

0 commit comments

Comments
 (0)