Documentation
¶
Overview ¶
Package subcmd implements simple command line interface subcommands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MultiStringFlag ¶
type MultiStringFlag struct {
Values []string
}
MultiStringFlag is a flag that can be specified multiple times. Use with flag.Var.
func (*MultiStringFlag) Set ¶
func (f *MultiStringFlag) Set(value string) error
func (*MultiStringFlag) String ¶
func (f *MultiStringFlag) String() string
type Option ¶
type Option struct {
// Name of the option. This must match what the user types for this option to be selected.
Name string
// Summary is a brief description of the option. Short: needs to fit in a list of all
// subcommands in the help text that summarizes all subcommand options.
Summary string
// Description is a description of the option that will be printed directly appended to Summary
// to optionally add more detail to the option-specific help message.
Description string
// TakeArgsReason is a brief description of why this option takes non-flag args and what it will
// do with them, or empty string (default) if the option doesn't accept non-flag args. If empty
// string, the Run function enforces that only flag args are passed to this option.
TakeArgsReason string
// Handle is called when this option is the one picked by the user. Handle must set up any
// additional flags on its own, run flag parsing by invoking p, then carry out the cmd. Handle
// is a single function rather than split into individual "Flags" and "Run" funcs so the flags
// can be declared succinctly as local variables.
Handle func(p ParseFunc) error
}
Click to show internal directories.
Click to hide internal directories.