Documentation ¶
Overview ¶
Package prog provides infrastructure for implementing programs with subcommands.
Usage is simple: initialize a MainProg var appropriately and call its .Main().
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandRegistry ¶
type CommandRegistry []Command
CommandRegistry is ordered collection of Commands.
func (CommandRegistry) Lookup ¶
func (cmdv CommandRegistry) Lookup(command string) *Command
Lookup returns Command with corresponding name or nil.
type HelpRegistry ¶
type HelpRegistry []HelpTopic
HelpRegistry is ordered collection of HelpTopics.
func (HelpRegistry) Lookup ¶
func (helpv HelpRegistry) Lookup(topic string) *HelpTopic
Lookup returns HelpTopic with corresponding name or nil.
type MainProg ¶
type MainProg struct { Name string // name of the program, e.g. "zodb" Summary string // 1-line summary of what program does Commands CommandRegistry // provided subcommands HelpTopics HelpRegistry // provided help topics }
MainProg defines a program to run with subcommands and help topics.
Click to show internal directories.
Click to hide internal directories.