mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-09 13:45:26 +02:00
Move completion package into cli
This commit is contained in:
@@ -4,17 +4,28 @@ package main
|
||||
|
||||
import (
|
||||
"kitty/tools/cli"
|
||||
"kitty/tools/cli/completion"
|
||||
"kitty/tools/cmd/at"
|
||||
"kitty/tools/completion"
|
||||
)
|
||||
|
||||
func completion_entry_point(tool_root *cli.Command) {
|
||||
tool_root.AddSubCommand(&cli.Command{
|
||||
Name: "__complete__", Hidden: true,
|
||||
Usage: "output_type [shell state...]",
|
||||
ShortDescription: "Generate completions for kitty commands",
|
||||
HelpText: "Generate completion candidates for kitty commands. The command line is read from STDIN. output_type can be one of the supported shells or 'json' for JSON output.",
|
||||
Run: func(cmd *cli.Command, args []string) (ret int, err error) {
|
||||
return ret, completion.Main(args)
|
||||
},
|
||||
})
|
||||
}
|
||||
func main() {
|
||||
root := cli.NewRootCommand()
|
||||
root.ShortDescription = "Fast, statically compiled implementations for various kitty command-line tools"
|
||||
root.Usage = "command [command options] [command args]"
|
||||
|
||||
at.EntryPoint(root)
|
||||
completion.EntryPoint(root)
|
||||
completion_entry_point(root)
|
||||
|
||||
root.Exec()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user