Skip to content

Commit

Permalink
Merge pull request #1845 from rsteube/capslock-compare
Browse files Browse the repository at this point in the history
capslock: complete files for compare output
  • Loading branch information
rsteube authored Sep 19, 2023
2 parents 68f874a + d5f238c commit 7178e78
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions completers/capslock_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,13 @@ func init() {
"output": carapace.ActionValues("json", "m", "v", "graph", "compare"),
"packages": golang.ActionPackages(),
})

carapace.Gen(rootCmd).PositionalCompletion(
carapace.ActionCallback(func(c carapace.Context) carapace.Action {
if rootCmd.Flag("output").Value.String() == "compare" {
return carapace.ActionFiles()
}
return carapace.ActionValues()
}),
)
}

0 comments on commit 7178e78

Please sign in to comment.