Documentation ¶
Index ¶
Constants ¶
View Source
const ( TAG_FLAG = "flag" TAG_HELPTEXT = "helptext" TAG_BINDING = "binding" TAG_DEFAULT = "default" TAG_VALIDATORS = "validators" TAG_BINDING_REQUIRED = "required" TAG_BINDING_IS_BOOL = "bool" )
Tags are the way the data can be marshalled into a given struct.
Variables ¶
This section is empty.
Functions ¶
func MarshallCommandArguments ¶
Marshall a given string slice into the given struct. This method will iterate over the given slice and check every `flag` tags in order to fill it with the correct value.
Example:
type myArgs struct { Directory string `flag:"-d" helptext:"directory" binding:"false" default:"./" validators:"path"` ShowHidden bool `flag:"-h" helptext:"shows hidden folders" binding:"isBool"` }
argsList := ["-d", "/memes", "-h"] args := &myArgs{}
MarshallCommandArguments(argsList, args)
args.Directory must contains "/memes" args.ShowHidden must be true
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.