Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type Parms ¶
type Parms struct { ByName ByName // contains filtered or unexported fields }
func New ¶
Define and parse {NAME{=|' '}VALUE} parameters from command arguments, e.g.
parm, args := parms.New([]string{ "-a", "A", "-b=B", "something"}, "-a", "-b", "-c")
results in
parm.ByName["-a"] == "A" parm.ByName["-b"] == "B" parm.ByName["-c"] == "" args == []string{"something"}
Parmeters may be defined with strings or string slices that include aliases of the first entry, e.g.
parm, args := parms.New([]string{"-color", "blue}, "-a", "-b", []string{"-c", "-color", "-colour"})
results in
parm.ByName["-a"] == "" parm.ByName["-b"] == "" parm.ByName["-c"] == "blue" args == []string{}
Click to show internal directories.
Click to hide internal directories.