From 58811d93936196bb488f2c0fb7cd11020413cf4f Mon Sep 17 00:00:00 2001 From: rsteube Date: Mon, 16 Oct 2023 00:32:40 +0200 Subject: [PATCH] tmp --- .../cmd/cli_activatePaneDirection.go | 29 +++++++++++++++++++ .../cmd/cli_getPaneDirection.go | 29 +++++++++++++++++++ pkg/actions/tools/wezterm/pane.go | 4 +++ 3 files changed, 62 insertions(+) create mode 100644 completers/wezterm_completer/cmd/cli_activatePaneDirection.go create mode 100644 completers/wezterm_completer/cmd/cli_getPaneDirection.go diff --git a/completers/wezterm_completer/cmd/cli_activatePaneDirection.go b/completers/wezterm_completer/cmd/cli_activatePaneDirection.go new file mode 100644 index 0000000000..38b9482660 --- /dev/null +++ b/completers/wezterm_completer/cmd/cli_activatePaneDirection.go @@ -0,0 +1,29 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/wezterm" + "github.com/spf13/cobra" +) + +var cli_activatePaneDirectionCmd = &cobra.Command{ + Use: "activate-pane-direction", + Short: "Activate an adjacent pane in the specified direction", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cli_activatePaneDirectionCmd).Standalone() + + cli_activatePaneDirectionCmd.Flags().BoolP("help", "h", false, "Print help") + cli_activatePaneDirectionCmd.Flags().String("pane-id", "", "Specify the current pane") + cliCmd.AddCommand(cli_activatePaneDirectionCmd) + + carapace.Gen(cli_activatePaneDirectionCmd).FlagCompletion(carapace.ActionMap{ + "pane-id": wezterm.ActionPanes(), + }) + + carapace.Gen(cli_activatePaneDirectionCmd).PositionalCompletion( + wezterm.ActionPaneDirections(), + ) +} diff --git a/completers/wezterm_completer/cmd/cli_getPaneDirection.go b/completers/wezterm_completer/cmd/cli_getPaneDirection.go new file mode 100644 index 0000000000..639c52ace9 --- /dev/null +++ b/completers/wezterm_completer/cmd/cli_getPaneDirection.go @@ -0,0 +1,29 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/wezterm" + "github.com/spf13/cobra" +) + +var cli_getPaneDirectionCmd = &cobra.Command{ + Use: "get-pane-direction", + Short: "Determine the adjacent pane in the specified direction", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(cli_getPaneDirectionCmd).Standalone() + + cli_getPaneDirectionCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") + cli_getPaneDirectionCmd.Flags().String("pane-id", "", "Specify the current pane") + cliCmd.AddCommand(cli_getPaneDirectionCmd) + + carapace.Gen(cli_getPaneDirectionCmd).FlagCompletion(carapace.ActionMap{ + "pane-id": wezterm.ActionPanes(), + }) + + carapace.Gen(cli_getPaneDirectionCmd).PositionalCompletion( + wezterm.ActionPaneDirections(), + ) +} diff --git a/pkg/actions/tools/wezterm/pane.go b/pkg/actions/tools/wezterm/pane.go index f127bdd394..1564634869 100644 --- a/pkg/actions/tools/wezterm/pane.go +++ b/pkg/actions/tools/wezterm/pane.go @@ -48,3 +48,7 @@ func ActionPanes() carapace.Action { return carapace.ActionValuesDescribed(vals...) }) } + +func ActionPaneDirections() carapace.Action { + return carapace.ActionValues("Up", "Down", "Left", "Right", "Next", "Prev") +}