Move kitty-tool __complete__ to use the new CLI framework

This commit is contained in:
Kovid Goyal
2022-09-23 12:30:41 +05:30
parent e7c14c78d0
commit 79cfc1e70a
6 changed files with 54 additions and 64 deletions

View File

@@ -3,27 +3,17 @@
package main
import (
"os"
"github.com/spf13/cobra"
"kitty/tools/cli"
"kitty/tools/cmd/at"
_ "kitty/tools/cmd/at"
"kitty/tools/completion"
)
func main() {
var root = cli.CreateCommand(&cobra.Command{
Use: "kitty-tool command [command options] [command args]",
Short: "Fast, statically compiled implementations for various kitty command-line tools",
})
root.AddCommand(at.EntryPoint(root))
root := cli.NewRootCommand()
root.ShortDescription = "Fast, statically compiled implementations for various kitty command-line tools"
root.Usage = "command [command options] [command args]"
// root.AddCommand(at.EntryPoint(root))
root.AddCommand(completion.EntryPoint(root))
cli.Init(root)
if err := cli.Execute(root); err != nil {
cli.PrintError(err)
os.Exit(1)
}
completion.EntryPoint(root)
root.Exec()
}