-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
edit.go
31 lines (26 loc) · 1.14 KB
/
edit.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/brew_completer/cmd/action"
"github.com/spf13/cobra"
)
var editCmd = &cobra.Command{
Use: "edit",
Short: "Open a <formula>, <cask> or <tap> in the editor set by `EDITOR` or `HOMEBREW_EDITOR`, or open the Homebrew repository for editing if no argument is provided",
GroupID: "developer",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(editCmd).Standalone()
editCmd.Flags().Bool("cask", false, "Treat all named arguments as casks.")
editCmd.Flags().Bool("debug", false, "Display any debugging information.")
editCmd.Flags().Bool("formula", false, "Treat all named arguments as formulae.")
editCmd.Flags().Bool("help", false, "Show this message.")
editCmd.Flags().Bool("print-path", false, "Print the file path to be edited, without opening an editor.")
editCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
editCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
rootCmd.AddCommand(editCmd)
carapace.Gen(editCmd).PositionalAnyCompletion(
action.ActionList(editCmd),
)
}