Documentation
¶
Index ¶
- func New(helpShort string, opts ...SectionOpt) wargcore.Section
- type SectionOpt
- func Command(name string, value wargcore.Command) SectionOpt
- func CommandMap(commands wargcore.CommandMap) SectionOpt
- func Footer(footer string) SectionOpt
- func HelpLong(helpLong string) SectionOpt
- func NewCommand(name string, helpShort string, action wargcore.Action, ...) SectionOpt
- func NewSection(name string, helpShort string, opts ...SectionOpt) SectionOpt
- func Section(name string, value wargcore.Section) SectionOpt
- func SectionMap(sections wargcore.SectionMap) SectionOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(helpShort string, opts ...SectionOpt) wargcore.Section
New creates a standalone wargcore.Section. All section options are in the go.bbkane.com/warg/section package
Types ¶
type SectionOpt ¶
SectionOpt customizes a Section on creation
func Command ¶
func Command(name string, value wargcore.Command) SectionOpt
Command adds an existing Command as a child of this Section. Panics if a Command with the same name already exists
func CommandMap ¶ added in v0.0.28
func CommandMap(commands wargcore.CommandMap) SectionOpt
CommandMap adds existing Commands as a child of this Section. Panics if a Command with the same name already exists
func Footer ¶
func Footer(footer string) SectionOpt
Footer adds an optional help string to this Section
func HelpLong ¶
func HelpLong(helpLong string) SectionOpt
HelpLong adds an optional help string to this Section
func NewCommand ¶ added in v0.0.28
func NewCommand(name string, helpShort string, action wargcore.Action, opts ...command.CommandOpt) SectionOpt
NewCommand creates a new Command as a child of this Section. Panics if a NewCommand with the same name already exists
func NewSection ¶ added in v0.0.28
func NewSection(name string, helpShort string, opts ...SectionOpt) SectionOpt
NewSection creates a new Section as a child of this Section. Panics if a NewSection with the same name already exists
func Section ¶
func Section(name string, value wargcore.Section) SectionOpt
Section adds an existing Section as a child of this Section. Panics if a Section with the same name already exists
func SectionMap ¶
func SectionMap(sections wargcore.SectionMap) SectionOpt
SectionMap adds existing Sections as a child of this Section. Panics if a Section with the same name already exists