Package cmdflag handles flag processing common to several go tools.
AddKnownFlags registers the flags in defns with base.AddKnownFlag.
FindGOFLAGS extracts and returns the flags matching defns from GOFLAGS. Ideally the caller would mention that the flags were from GOFLAGS when reporting errors, but that's too hard for now.
IsBool reports whether v is a bool flag.
SetBool sets the addressed boolean to the value.
SetInt sets the addressed integer to the value.
SyntaxError reports an argument syntax error and exits the program.
Defn defines a flag we know about.
Parse sees if argument i is present in the definitions and if so, returns its definition, value, and whether it consumed an extra word. If the flag begins (cmd+".") it is ignored for the purpose of this function.