Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Oct 15, 2023
1 parent 35664dc commit 58811d9
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
29 changes: 29 additions & 0 deletions completers/wezterm_completer/cmd/cli_activatePaneDirection.go
Original file line number Diff line number Diff line change
@@ -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(),
)
}
29 changes: 29 additions & 0 deletions completers/wezterm_completer/cmd/cli_getPaneDirection.go
Original file line number Diff line number Diff line change
@@ -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(),
)
}
4 changes: 4 additions & 0 deletions pkg/actions/tools/wezterm/pane.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

0 comments on commit 58811d9

Please sign in to comment.