Skip to content

Commit

Permalink
Merge pull request #1045 from rsteube/add-batman
Browse files Browse the repository at this point in the history
added batman
  • Loading branch information
rsteube authored Apr 14, 2022
2 parents 7d09383 + 775d1f1 commit 7d2bfbb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
27 changes: 27 additions & 0 deletions completers/batman_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cmd

import (
"github.com/rsteube/carapace"
man "github.com/rsteube/carapace-bin/completers/man_completer/cmd"
"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "batman",
Short: "Read system manual pages (man) using bat",
Long: "https://github.com/eth-p/bat-extras/blob/master/doc/batman.md",
Run: func(cmd *cobra.Command, args []string) {},
DisableFlagParsing: true,
}

func Execute() error {
return rootCmd.Execute()
}

func init() {
carapace.Gen(rootCmd).Standalone()

carapace.Gen(rootCmd).PositionalAnyCompletion(
man.ActionExecute(),
)
}
7 changes: 7 additions & 0 deletions completers/batman_completer/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/rsteube/carapace-bin/completers/batman_completer/cmd"

func main() {
cmd.Execute()
}
5 changes: 5 additions & 0 deletions completers/man_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ var rootCmd = &cobra.Command{
func Execute() error {
return rootCmd.Execute()
}

func ActionExecute() carapace.Action {
return carapace.ActionExecute(rootCmd)
}

func init() {
carapace.Gen(rootCmd).Standalone()

Expand Down

0 comments on commit 7d2bfbb

Please sign in to comment.