-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
help.go
36 lines (30 loc) · 938 Bytes
/
help.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
35
36
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var helpCmd = &cobra.Command{
Use: "help [command]",
Short: "Help about any command",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(helpCmd).Standalone()
rootCmd.AddCommand(helpCmd)
carapace.Gen(helpCmd).PositionalCompletion(
carapace.Batch(
carapace.ActionCommands(rootCmd),
carapace.ActionValuesDescribed(
"actions", "Learn about working with GitHub Actions",
"environment", "Environment variables that can be used with gh",
"exit-codes", "Exit codes used by gh",
"formatting", "Formatting options for JSON data exported from gh",
"mintty", "Information about using gh with MinTTY",
"reference", "A comprehensive reference of all gh commands",
).Tag("help topics"),
).ToA(),
)
carapace.Gen(helpCmd).PositionalAnyCompletion(
carapace.ActionCommands(rootCmd),
)
}