Debian Codegraph @

v2/duration.go

raw symbols SCIP
1 // Copyright 2017 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 getopt
6
7 import "time"
8
9 // Duration creates an option that parses its value as a time.Duration.
10 func Duration(name rune, value time.Duration, helpvalue ...string) *time.Duration {
11 CommandLine.FlagLong(&value, "", name, helpvalue...)
12 return &value
13 }
14
15 func (s *Set) Duration(name rune, value time.Duration, helpvalue ...string) *time.Duration {
16 s.FlagLong(&value, "", name, helpvalue...)
17 return &value
18 }
19
20 func DurationLong(name string, short rune, value time.Duration, helpvalue ...string) *time.Duration {
21 CommandLine.FlagLong(&value, name, short, helpvalue...)
22 return &value
23 }
24
25 func (s *Set) DurationLong(name string, short rune, value time.Duration, helpvalue ...string) *time.Duration {
26 s.FlagLong(&value, name, short, helpvalue...)
27 return &value
28 }