section

package
v0.0.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

type SectionOpt func(*wargcore.Section)

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(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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL