main.go 940 B

123456789101112131415161718192021222324252627282930313233343536
  1. // License: GPLv3 Copyright: 2022, Kovid Goyal, <kovid at kovidgoyal.net>
  2. package main
  3. import (
  4. "os"
  5. "kitty/kittens/ssh"
  6. "kitty/tools/cli"
  7. "kitty/tools/cmd/completion"
  8. "kitty/tools/cmd/tool"
  9. )
  10. func main() {
  11. krm := os.Getenv("KITTY_KITTEN_RUN_MODULE")
  12. os.Unsetenv("KITTY_KITTEN_RUN_MODULE")
  13. switch krm {
  14. case "ssh_askpass":
  15. ssh.RunSSHAskpass()
  16. return
  17. }
  18. root := cli.NewRootCommand()
  19. root.ShortDescription = "Fast, statically compiled implementations of various kittens (command line tools for use with kitty)"
  20. root.HelpText = "kitten serves as a launcher for running individual kittens. Each kitten can be run as :code:`kitten command`. The list of available kittens is given below."
  21. root.Usage = "command [command options] [command args]"
  22. root.Run = func(cmd *cli.Command, args []string) (int, error) {
  23. cmd.ShowHelp()
  24. return 0, nil
  25. }
  26. tool.KittyToolEntryPoints(root)
  27. completion.EntryPoint(root)
  28. root.Exec()
  29. }