Documentation ¶
Overview ¶
Package cmdflag handles flag processing common to several go tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKnownFlags ¶
AddKnownFlags registers the flags in defns with base.AddKnownFlag.
func FindGOFLAGS ¶
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.
func SyntaxError ¶
func SyntaxError(cmd, msg string)
SyntaxError reports an argument syntax error and exits the program.
Types ¶
type Defn ¶
type Defn struct { Name string // Name on command line. BoolVar *bool // If it's a boolean flag, this points to it. Value flag.Value // The flag.Value represented. PassToTest bool // Pass to the test binary? Used only by go test. Present bool // Flag has been seen. }
Defn defines a flag we know about.
Click to show internal directories.
Click to hide internal directories.