Skip to content

Commit

Permalink
Merge pull request #1047 from rsteube/add-prettybat
Browse files Browse the repository at this point in the history
added prettybat
  • Loading branch information
rsteube authored Apr 14, 2022
2 parents b1524c0 + 9dde803 commit 97524ff
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions completers/bat_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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
26 changes: 26 additions & 0 deletions completers/prettybat_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package cmd

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

var rootCmd = &cobra.Command{
Use: "prettybat",
Short: "Pretty-print source code and highlight it with bat",
Long: "https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.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(
bat.ActionExecute(),
)
}
7 changes: 7 additions & 0 deletions completers/prettybat_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/prettybat_completer/cmd"

func main() {
cmd.Execute()
}

0 comments on commit 97524ff

Please sign in to comment.