Message:
Hello golan...@googlegroups.com,
I'd like you to review this change.
Description:
flag: handle multiple calls to flag.Parse
Please review this at http://codereview.appspot.com/3071041/
Affected files:
M src/pkg/flag/flag.go
This change keeps flag.Parse from crashing if called multiple times.
It also lets one do things like
flag.Parse()
switch flag.Arg(0) {
case "cmd1":
... add more flags
case "cmd2":
... add more flags
}
os.Args = flag.Args()
flag.Parse()
to implement the common subcommand
command line parsing found in tools like
Mercurial. I'm not sure if that's a good thing,
but not crashing certainly is.
Please take another look.
flag: handle multiple calls to flag.Parse
R=r
CC=golang-dev
http://codereview.appspot.com/3071041