Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse takes a string of comma-separated k=v pairs and parses it to a struct
For example the string "name=Titanic,year=1997" could be parsed into a struct like:
type Film struct { Name string `arg:"name"` Year int `arg:"year"` Origin string `arg:"origin,Hollywood" }
Note that no "origin" was specified, so it will be set to the default "Hollywood". If no default value is given, the argument is required. Unused arguments are treated as errors.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.