mirror of
https://github.com/rsteube/carapace-bin.git
synced 2025-05-05 15:32:53 +00:00
tldr: support variants
This commit is contained in:
parent
49418e2676
commit
8375592eef
@ -133,6 +133,19 @@ func readCompleters() ([]string, map[string]string) {
|
||||
description := readDescription(root, file.Name())
|
||||
names = append(names, name)
|
||||
descriptions[name] = description
|
||||
|
||||
if files, err := os.ReadDir(root + "/completers/" + file.Name()); err == nil {
|
||||
for _, file := range files {
|
||||
if file.IsDir() && file.Name() != "cmd" { // variants of completer (same binary name different ommand)
|
||||
variant := fmt.Sprintf("%v/%v", name, file.Name())
|
||||
// description := readDescription(root, file.Name())
|
||||
description := "TODO"
|
||||
names = append(names, variant)
|
||||
descriptions[variant] = description
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
package main
|
||||
|
||||
import "github.com/carapace-sh/carapace-bin/completers/tealdeer_completer/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package main
|
||||
|
||||
import "github.com/carapace-sh/carapace-bin/completers/tldr_completer/cmd"
|
||||
import "github.com/carapace-sh/carapace-bin/completers/tldr_completer/python/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
|
7
completers/tldr_completer/python/main.go
Normal file
7
completers/tldr_completer/python/main.go
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "github.com/carapace-sh/carapace-bin/completers/tldr_completer/python/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
}
|
@ -41,7 +41,7 @@ func init() {
|
||||
carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
|
||||
"color": carapace.ActionValues("always", "auto", "never").StyleF(style.ForKeyword),
|
||||
"language": os.ActionLanguages(),
|
||||
"platform": carapace.ActionValues("linux", "macos"),
|
||||
"platform": carapace.ActionValues("linux", "macos", "windows", "sunos", "osx", "android"),
|
||||
"render": carapace.ActionFiles(),
|
||||
})
|
||||
|
7
completers/tldr_completer/tealdeer/main.go
Normal file
7
completers/tldr_completer/tealdeer/main.go
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "github.com/carapace-sh/carapace-bin/completers/tldr_completer/tealdeer/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user