Documentation
¶
Overview ¶
Package help implements the help command with search and discovery features.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectTopics ¶
CollectTopics returns all unique topics defined in the command tree.
func NewCmdHelp ¶
NewCmdHelp creates the help command with search and discovery features.
func RegisterTopicEnum ¶
RegisterTopicEnum registers the standard topics as enum values for --topic flag.
Types ¶
type CommandInfo ¶
type CommandInfo struct {
Path string // Full command path (e.g., "gc pr view")
Name string // Command name (e.g., "view")
Short string // Short description
Topic string // Topic category (from annotation)
Aliases []string // Command aliases
Hidden bool // Whether command is hidden
}
CommandInfo holds metadata about a command for search and discovery.
func BuildIndex ¶
func BuildIndex(root *cobra.Command) []CommandInfo
BuildIndex traverses the command tree and builds a searchable index.
func FilterByTopic ¶
func FilterByTopic(index []CommandInfo, topic string) []CommandInfo
FilterByTopic returns commands belonging to a specific topic.
func Search ¶
func Search(index []CommandInfo, keyword string) []CommandInfo
Search finds commands matching the given keyword. Matches against path, name, short description, and aliases.
Source Files
¶
- help.go
- search.go
Click to show internal directories.
Click to hide internal directories.