Start moving clipboard kitten to kitty-tool

This commit is contained in:
Kovid Goyal
2022-11-25 12:58:10 +05:30
parent fbce5e7524
commit 4d3f3b5e91
9 changed files with 167 additions and 28 deletions

View File

@@ -14,6 +14,8 @@ import (
var _ = fmt.Print
type RunFunc = func(cmd *Command, args []string) (int, error)
type Command struct {
Name, Group string
Usage, ShortDescription, HelpText string
@@ -26,7 +28,7 @@ type Command struct {
// If true subcommands are ignored unless they are the first non-option argument
SubCommandMustBeFirst bool
// The entry point for this command
Run func(cmd *Command, args []string) (int, error)
Run RunFunc
// The completer for args
ArgCompleter CompletionFunc
// Stop completion processing at this arg num

View File

@@ -0,0 +1,18 @@
// License: GPLv3 Copyright: 2022, Kovid Goyal, <kovid at kovidgoyal.net>
package clipboard
import (
"fmt"
"kitty/tools/cli"
)
var _ = fmt.Print
func clipboard_main(cmd *cli.Command, args []string) (int, error) {
return 0, nil
}
func EntryPoint(parent *cli.Command) {
create_cmd(parent, clipboard_main)
}

View File

@@ -4,8 +4,10 @@ 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"
)
@@ -21,4 +23,6 @@ func KittyToolEntryPoints(root *cli.Command) {
update_self.EntryPoint(root)
// edit-in-kitty
edit_in_kitty.EntryPoint(root)
// clipboard
clipboard.EntryPoint(root)
}