-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
bugs.go
34 lines (28 loc) · 832 Bytes
/
bugs.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
32
33
34
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/npm_completer/cmd/action"
"github.com/spf13/cobra"
)
var bugsCmd = &cobra.Command{
Use: "bugs",
Short: "Report bugs for a package in a web browser",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(bugsCmd).Standalone()
bugsCmd.Flags().String("browser", "", "browser called to open websites")
rootCmd.AddCommand(bugsCmd)
carapace.Gen(bugsCmd).FlagCompletion(carapace.ActionMap{
"browser": carapace.ActionValuesDescribed(
"open", "osx default",
"start", "windows default",
"xdg-open", "others default",
"false", "print urls to terminal",
"true", "use system default",
),
})
carapace.Gen(bugsCmd).PositionalAnyCompletion(
action.ActionPackages(bugsCmd),
)
}