Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1073)

Issue 6944064: code review 6944064: flag: add implicit boolFlag interface (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by rick
Modified:
11 years, 3 months ago
Reviewers:
CC:
bradfitz, rsc, golang-dev
Visibility:
Public.

Description

flag: add implicit boolFlag interface Any flag.Value that has an IsBoolFlag method that returns true will be treated as a bool flag type during parsing. Fixes issue 4262.

Patch Set 1 #

Patch Set 2 : diff -r e29b9036a11a https://code.google.com/p/go/ #

Patch Set 3 : diff -r e29b9036a11a https://code.google.com/p/go/ #

Total comments: 2

Patch Set 4 : diff -r 41b82b6b2ccd https://code.google.com/p/go/ #

Total comments: 4

Patch Set 5 : diff -r 41b82b6b2ccd https://code.google.com/p/go/ #

Total comments: 1

Patch Set 6 : diff -r 41b82b6b2ccd https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -1 line) Patch
M src/pkg/flag/flag.go View 1 2 3 4 5 3 chunks +14 lines, -1 line 0 comments Download
M src/pkg/flag/flag_test.go View 1 2 3 4 1 chunk +41 lines, -0 lines 0 comments Download

Messages

Total messages: 9
rick
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 3 months ago (2012-12-18 01:11:26 UTC) #1
bradfitz
https://codereview.appspot.com/6944064/diff/5001/src/pkg/flag/flag_test.go File src/pkg/flag/flag_test.go (right): https://codereview.appspot.com/6944064/diff/5001/src/pkg/flag/flag_test.go#newcode221 src/pkg/flag/flag_test.go:221: if err := flags.Parse([]string{"-v", "1", "-b", "-v", "2", "-v=3", ...
11 years, 3 months ago (2012-12-20 20:11:00 UTC) #2
rick
PTAL https://codereview.appspot.com/6944064/diff/5001/src/pkg/flag/flag_test.go File src/pkg/flag/flag_test.go (right): https://codereview.appspot.com/6944064/diff/5001/src/pkg/flag/flag_test.go#newcode221 src/pkg/flag/flag_test.go:221: if err := flags.Parse([]string{"-v", "1", "-b", "-v", "2", ...
11 years, 3 months ago (2012-12-20 21:51:26 UTC) #3
bradfitz
https://codereview.appspot.com/6944064/diff/9001/src/pkg/flag/flag_test.go File src/pkg/flag/flag_test.go (right): https://codereview.appspot.com/6944064/diff/9001/src/pkg/flag/flag_test.go#newcode221 src/pkg/flag/flag_test.go:221: if err := flags.Parse([]string{"-v", "1", "-b", "-v", "2", "-v=3", ...
11 years, 3 months ago (2012-12-20 22:08:34 UTC) #4
rick
PTAL https://codereview.appspot.com/6944064/diff/9001/src/pkg/flag/flag_test.go File src/pkg/flag/flag_test.go (right): https://codereview.appspot.com/6944064/diff/9001/src/pkg/flag/flag_test.go#newcode221 src/pkg/flag/flag_test.go:221: if err := flags.Parse([]string{"-v", "1", "-b", "-v", "2", ...
11 years, 3 months ago (2012-12-20 22:35:54 UTC) #5
rsc
https://codereview.appspot.com/6944064/diff/13001/src/pkg/flag/flag.go File src/pkg/flag/flag.go (right): https://codereview.appspot.com/6944064/diff/13001/src/pkg/flag/flag.go#newcode720 src/pkg/flag/flag.go:720: if fv, ok := flag.Value.(boolFlag); ok && flag.Value.(boolFlag).IsBoolFlag() { ...
11 years, 3 months ago (2012-12-22 16:38:31 UTC) #6
rick
PTAL
11 years, 3 months ago (2012-12-22 16:45:24 UTC) #7
rsc
LGTM
11 years, 3 months ago (2012-12-22 18:33:20 UTC) #8
rsc
11 years, 3 months ago (2012-12-22 18:34:51 UTC) #9
*** Submitted as https://code.google.com/p/go/source/detail?r=7bc3fb12f064 ***

flag: add implicit boolFlag interface

Any flag.Value that has an IsBoolFlag method that returns true
will be treated as a bool flag type during parsing.

Fixes issue 4262.

R=bradfitz, rsc
CC=golang-dev
https://codereview.appspot.com/6944064

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b