| 1 | // Copyright 2015 Google Inc. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package getoptscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/ |
| 6 | |
| 7 | import "timescip-go gomod github.com/golang/go/src go1.13 time/" |
| 8 | |
| 9 | type durationValuescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/durationValue# timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration# |
| 10 | |
| 11 | func (d *durationValuescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/durationValue#) Setscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/durationValue#Set().(value string, opt Optionscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Option#) error { |
| 12 | v, err := timescip-go gomod github.com/golang/go/src go1.13 time/.ParseDurationscip-go gomod github.com/golang/go/src go1.13 time/ParseDuration().(value) |
| 13 | if err != nil { |
| 14 | return err |
| 15 | } |
| 16 | *d = durationValuescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/durationValue#(v) |
| 17 | return nil |
| 18 | } |
| 19 | |
| 20 | func (d *durationValuescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/durationValue#) Stringscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/durationValue#String().() string { |
| 21 | return timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#(*d).Stringscip-go gomod github.com/golang/go/src go1.13 time/Duration#String().() |
| 22 | } |
| 23 | |
| 24 | // Duration creates an option that parses its value as a time.Duration. |
| 25 | func Durationscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Duration().(name rune, value timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#, helpvalue ...string) *timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration# { |
| 26 | return CommandLinescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/CommandLine..Durationscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#Duration().(name, value, helpvalue...) |
| 27 | } |
| 28 | |
| 29 | func (s *Setscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#) Durationscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#Duration().(name rune, value timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#, helpvalue ...string) *timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration# { |
| 30 | return s.DurationLongscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#DurationLong().("", name, value, helpvalue...) |
| 31 | } |
| 32 | |
| 33 | func DurationLongscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/DurationLong().(name string, short rune, value timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#, helpvalue ...string) *timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration# { |
| 34 | return CommandLinescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/CommandLine..DurationLongscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#DurationLong().(name, short, value, helpvalue...) |
| 35 | } |
| 36 | |
| 37 | func (s *Setscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#) DurationLongscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#DurationLong().(name string, short rune, value timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#, helpvalue ...string) *timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration# { |
| 38 | s.DurationVarLongscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#DurationVarLong().(&value, name, short, helpvalue...) |
| 39 | return &value |
| 40 | } |
| 41 | |
| 42 | func DurationVarscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/DurationVar().(p *timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#, name rune, helpvalue ...string) Optionscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Option# { |
| 43 | return CommandLinescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/CommandLine..DurationVarscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#DurationVar().(p, name, helpvalue...) |
| 44 | } |
| 45 | |
| 46 | func (s *Setscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#) DurationVarscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#DurationVar().(p *timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#, name rune, helpvalue ...string) Optionscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Option# { |
| 47 | return s.DurationVarLongscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#DurationVarLong().(p, "", name, helpvalue...) |
| 48 | } |
| 49 | |
| 50 | func DurationVarLongscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/DurationVarLong().(p *timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#, name string, short rune, helpvalue ...string) Optionscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Option# { |
| 51 | return CommandLinescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/CommandLine..DurationVarLongscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#DurationVarLong().(p, name, short, helpvalue...) |
| 52 | } |
| 53 | |
| 54 | func (s *Setscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#) DurationVarLongscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#DurationVarLong().(p *timescip-go gomod github.com/golang/go/src go1.13 time/.Durationscip-go gomod github.com/golang/go/src go1.13 time/Duration#, name string, short rune, helpvalue ...string) Optionscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Option# { |
| 55 | return s.VarLongscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Set#VarLong().((*durationValuescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/durationValue#)(p), name, short, helpvalue...) |
| 56 | } |