Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support variants #2356

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cmd/carapace-generate/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
}
}
}
}
}
Expand Down
7 changes: 0 additions & 7 deletions completers/tealdeer_completer/main.go

This file was deleted.

2 changes: 1 addition & 1 deletion completers/tldr_completer/main.go
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
7 changes: 7 additions & 0 deletions completers/tldr_completer/python/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/carapace-sh/carapace-bin/completers/tldr_completer/python/cmd"

func main() {
cmd.Execute()
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
})

Expand Down
7 changes: 7 additions & 0 deletions completers/tldr_completer/tealdeer/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/carapace-sh/carapace-bin/completers/tldr_completer/tealdeer/cmd"

func main() {
cmd.Execute()
}
Loading