Make kitten main re-useable

This commit is contained in:
Kovid Goyal 2025-05-13 18:51:49 +05:30
parent 6282a46ff1
commit 123a115836
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -11,7 +11,7 @@ import (
"kitty/tools/cmd/tool"
)
func main() {
func KittenMain(args ...string) {
krm := os.Getenv("KITTY_KITTEN_RUN_MODULE")
os.Unsetenv("KITTY_KITTEN_RUN_MODULE")
switch krm {
@ -31,5 +31,9 @@ func main() {
tool.KittyToolEntryPoints(root)
completion.EntryPoint(root)
root.Exec()
root.Exec(args...)
}
func main() {
KittenMain()
}