• Rob Pike's avatar
    flags: allow distinct sets of flags. · f4fe688b
    Rob Pike authored
    A FlagSet is an independent set of flags that may be used,
    for example, to provide flag processing for subcommands
    in a CLI.  The standard, os.Args-derived set of flags is a
    global but non-exported FlagSet and the standard functions
    are wrappers for methods of that FlagSet.
    
    Allow the programmer to control whether the program
    exits if there is a parse error.  For the default set, the behavior
    remains to exit on error.
    
    The handling of Usage is odd due to backward compatibility.
    
    R=golang-dev, bradfitz, r, bradfitz
    CC=golang-dev
    https://golang.org/cl/4517092
    f4fe688b
flag_test.go 5.2 KB