kitty/tools/cmd/tool/main.go
Kovid Goyal f5d2c35755
Move implementation of +hold to Go
No need to pay python interpreter startup cost for --hold
2022-12-01 22:34:56 +05:30

40 lines
867 B
Go

// License: GPLv3 Copyright: 2022, Kovid Goyal, <kovid at kovidgoyal.net>
package tool
import (
"fmt"
"kitty/tools/cli"
"kitty/tools/cmd/at"
"kitty/tools/cmd/clipboard"
"kitty/tools/cmd/edit_in_kitty"
"kitty/tools/cmd/update_self"
"kitty/tools/tui"
)
var _ = fmt.Print
func KittyToolEntryPoints(root *cli.Command) {
root.Add(cli.OptionSpec{
Name: "--version", Type: "bool-set", Help: "The current kitty version."})
// @
at.EntryPoint(root)
// update-self
update_self.EntryPoint(root)
// edit-in-kitty
edit_in_kitty.EntryPoint(root)
// clipboard
clipboard.EntryPoint(root)
// __hold_till_enter__
root.AddSubCommand(&cli.Command{
Name: "__hold_till_enter__",
Hidden: true,
OnlyArgsAllowed: true,
Run: func(cmd *cli.Command, args []string) (rc int, err error) {
tui.ExecAndHoldTillEnter(args)
return
},
})
}