From 20b35cfadf61c8bd19c924881b205893259f7655 Mon Sep 17 00:00:00 2001 From: rsteube Date: Tue, 1 Aug 2023 10:41:56 +0200 Subject: [PATCH] added showkey --- completers/showkey_completer/cmd/root.go | 26 ++++++++++++++++++++++++ completers/showkey_completer/main.go | 7 +++++++ 2 files changed, 33 insertions(+) create mode 100644 completers/showkey_completer/cmd/root.go create mode 100644 completers/showkey_completer/main.go diff --git a/completers/showkey_completer/cmd/root.go b/completers/showkey_completer/cmd/root.go new file mode 100644 index 0000000000..f5b1bca460 --- /dev/null +++ b/completers/showkey_completer/cmd/root.go @@ -0,0 +1,26 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "showkey", + Short: "examine the codes sent by the keyboard", + Long: "https://linux.die.net/man/1/showkey", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func Execute() error { + return rootCmd.Execute() +} +func init() { + carapace.Gen(rootCmd).Standalone() + + rootCmd.Flags().BoolP("ascii", "a", false, "display the decimal/octal/hex values of the keys") + rootCmd.Flags().BoolP("help", "h", false, "print this usage message") + rootCmd.Flags().BoolP("keycodes", "k", false, "display only the interpreted keycodes (default)") + rootCmd.Flags().BoolP("scancodes", "s", false, "display only the raw scan-codes") + rootCmd.Flags().BoolP("version", "V", false, "print version number") +} diff --git a/completers/showkey_completer/main.go b/completers/showkey_completer/main.go new file mode 100644 index 0000000000..aef01f2866 --- /dev/null +++ b/completers/showkey_completer/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/rsteube/carapace-bin/completers/showkey_completer/cmd" + +func main() { + cmd.Execute() +}