]> Cypherpunks repositories - gostls13.git/commitdiff
Explain why
authorRob Pike <r@golang.org>
Fri, 13 Nov 2009 21:15:18 +0000 (13:15 -0800)
committerRob Pike <r@golang.org>
Fri, 13 Nov 2009 21:15:18 +0000 (13:15 -0800)
-flag true
does not work although
-flag=true
does.

Fixes #139.

R=iant
CC=golang-dev
https://golang.org/cl/154118

src/pkg/flag/flag.go

index ff72c08e24274dad9f5d14d549f661f54f24398f..0471d126c04cfadd3a1c01a03fd5086bbadad7cb 100644 (file)
        Command line flag syntax:
                -flag
                -flag=x
-               -flag x
+               -flag x  // non-boolean flags only
        One or two minus signs may be used; they are equivalent.
+       The last form is not permitted for boolean flags because the
+       meaning of the command
+               cmd -x *
+       will change if there is a file called 0, false, etc.  You must
+       use the -flag=false form to turn off a boolean flag.
 
        Flag parsing stops just before the first non-flag argument
        ("-" is a non-flag argument) or after the terminator "--".