From cf6bb29ef778bde42026e46e92ae3196cbc7bad8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 Apr 2025 20:28:43 +0530 Subject: [PATCH] Start work on width testing kitten --- testing_exports.go => embeds.go | 2 -- tools/cli/wcswidth_kitten.go | 25 +++++++++++++++++++++++++ tools/cmd/tool/main.go | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) rename testing_exports.go => embeds.go (87%) create mode 100644 tools/cli/wcswidth_kitten.go diff --git a/testing_exports.go b/embeds.go similarity index 87% rename from testing_exports.go rename to embeds.go index b6741d086..eb7e08ec4 100644 --- a/testing_exports.go +++ b/embeds.go @@ -1,5 +1,3 @@ -//go:build testing - package kitty import ( diff --git a/tools/cli/wcswidth_kitten.go b/tools/cli/wcswidth_kitten.go new file mode 100644 index 000000000..09a6c9417 --- /dev/null +++ b/tools/cli/wcswidth_kitten.go @@ -0,0 +1,25 @@ +package cli + +import ( + "fmt" +) + +var _ = fmt.Print + +func main() (rc int, err error) { + return +} + +func WcswidthKittenEntryPoint(root *Command) { + root.AddSubCommand(&Command{ + Name: "__width_test__", + Hidden: true, + OnlyArgsAllowed: true, + Run: func(cmd *Command, args []string) (rc int, err error) { + if len(args) != 0 { + return 1, fmt.Errorf("Usage: __width_test__") + } + return main() + }, + }) +} diff --git a/tools/cmd/tool/main.go b/tools/cmd/tool/main.go index 86d5c3540..aa608cd69 100644 --- a/tools/cmd/tool/main.go +++ b/tools/cmd/tool/main.go @@ -122,6 +122,8 @@ func KittyToolEntryPoints(root *cli.Command) { images.ConvertEntryPoint(root) // __atexit__ atexit.EntryPoint(root) + // __width_test__ + cli.WcswidthKittenEntryPoint(root) // __generate_man_pages__ root.AddSubCommand(&cli.Command{ Name: "__generate_man_pages__",