Documentation ¶
Overview ¶
Package flagg provides a simple means of constructing CLI command hierarchies. A hierarchy is simply a tree of flag.FlagSets; the Parse function is then used to determine which command is being invoked.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Root = flag.CommandLine
Root is the default root flag.FlagSet.
Functions ¶
func IsDefined ¶ added in v1.1.0
IsDefined returns true if flg was supplied to cmd. IsDefined may only be called after cmd has been parsed.
func New ¶
New returns a new flag.FlagSet. It is equivalent to flag.NewFlagSet(name, flag.ExitOnError), and setting f.Usage = SimpleUsage(f, usage)
func Parse ¶
Parse parses os.Args according to the supplied Tree. It returns the most deeply-nested flag.FlagSet selected by the args.
func SimpleUsage ¶
SimpleUsage returns a func that writes usage to cmd.Output(). If cmd has associated flags, the func also calls cmd.PrintDefaults.