diff options
author | Rob Pike <r@golang.org> | 2009-11-13 13:15:18 -0800 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2009-11-13 13:15:18 -0800 |
commit | 15c8202afb972cb92358c75e3263e878d72fb73a (patch) | |
tree | b134e6bd25dc4916d60aa687d193a1c70c96b577 /src/pkg/flag | |
parent | fb2b99ba8d5b4507980fb2cd97af2d2677bd01bb (diff) | |
download | golang-15c8202afb972cb92358c75e3263e878d72fb73a.tar.gz |
Explain why
-flag true
does not work although
-flag=true
does.
Fixes issue 139.
R=iant
CC=golang-dev
http://codereview.appspot.com/154118
Diffstat (limited to 'src/pkg/flag')
-rw-r--r-- | src/pkg/flag/flag.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pkg/flag/flag.go b/src/pkg/flag/flag.go index ff72c08e2..0471d126c 100644 --- a/src/pkg/flag/flag.go +++ b/src/pkg/flag/flag.go @@ -31,8 +31,13 @@ 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 "--". |