~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/flag/flag.go

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-11-18 15:12:26 UTC
  • mfrom: (14.2.12 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20141118151226-zug7vn93mn3dtiz3
Tags: 2:1.3.2-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - Support co-installability with gccgo-go tool:
    - d/rules,golang-go.install: Rename bin/go -> bin/golang-go
    - d/golang-go.{postinst,prerm}: Install/remove /usr/bin/go using
      alternatives.
  - d/copyright: Amendments for full compiliance with copyright format.
  - d/control: Demote golang-go.tools to Suggests to support Ubuntu MIR.
  - dropped patches (now upstream):
    - d/p/issue27650045_40001_50001.diff
    - d/p/issue28050043_60001_70001.diff
    - d/p/issue54790044_100001_110001.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        ("-" is a non-flag argument) or after the terminator "--".
51
51
 
52
52
        Integer flags accept 1234, 0664, 0x1234 and may be negative.
53
 
        Boolean flags may be 1, 0, t, f, true, false, TRUE, FALSE, True, False.
 
53
        Boolean flags may be:
 
54
                1, 0, t, f, T, F, true, false, TRUE, FALSE, True, False
54
55
        Duration flags accept any input valid for time.ParseDuration.
55
56
 
56
57
        The default set of command-line flags is controlled by
269
270
        actual        map[string]*Flag
270
271
        formal        map[string]*Flag
271
272
        args          []string // arguments after flags
272
 
        exitOnError   bool     // does the program exit if there's an error?
273
273
        errorHandling ErrorHandling
274
274
        output        io.Writer // nil means stderr; use out() accessor
275
275
}
755
755
        if fv, ok := flag.Value.(boolFlag); ok && fv.IsBoolFlag() { // special case: doesn't need an arg
756
756
                if has_value {
757
757
                        if err := fv.Set(value); err != nil {
758
 
                                return false, f.failf("invalid boolean value %q for  -%s: %v", value, name, err)
 
758
                                return false, f.failf("invalid boolean value %q for -%s: %v", value, name, err)
759
759
                        }
760
760
                } else {
761
761
                        fv.Set("true")