More work on readline completion

This commit is contained in:
Kovid Goyal
2022-11-12 11:27:27 +05:30
parent 4974219e0f
commit 9e2c96653f
5 changed files with 80 additions and 16 deletions

View File

@@ -51,14 +51,6 @@ func RegisterExeForCompletion(x func(root *Command)) {
registered_exes = append(registered_exes, x)
}
func CompletionsForArgv(argv []string) *Completions {
var root = NewRootCommand()
for _, re := range registered_exes {
re(root)
}
return root.GetCompletions(argv, init_completions["json"])
}
func GenerateCompletions(args []string) error {
output_type := "json"
if len(args) > 0 {