forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flag_constructor.go
37 lines (28 loc) · 1.63 KB
/
flag_constructor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package flags
func (c *flagContext) NewStringFlag(name string, shortName string, usage string) {
c.cmdFlags[name] = &StringFlag{Name: name, ShortName: shortName, Usage: usage}
}
func (c *flagContext) NewStringFlagWithDefault(name string, shortName string, usage string, value string) {
c.cmdFlags[name] = &StringFlag{Name: name, ShortName: shortName, Value: value, Usage: usage}
}
func (c *flagContext) NewBoolFlag(name string, shortName string, usage string) {
c.cmdFlags[name] = &BoolFlag{Name: name, ShortName: shortName, Usage: usage}
}
func (c *flagContext) NewIntFlag(name string, shortName string, usage string) {
c.cmdFlags[name] = &IntFlag{Name: name, ShortName: shortName, Usage: usage}
}
func (c *flagContext) NewIntFlagWithDefault(name string, shortName string, usage string, value int) {
c.cmdFlags[name] = &IntFlag{Name: name, ShortName: shortName, Value: value, Usage: usage}
}
func (c *flagContext) NewFloat64Flag(name string, shortName string, usage string) {
c.cmdFlags[name] = &Float64Flag{Name: name, ShortName: shortName, Usage: usage}
}
func (c *flagContext) NewFloat64FlagWithDefault(name string, shortName string, usage string, value float64) {
c.cmdFlags[name] = &Float64Flag{Name: name, ShortName: shortName, Value: value, Usage: usage}
}
func (c *flagContext) NewStringSliceFlag(name string, shortName string, usage string) {
c.cmdFlags[name] = &StringSliceFlag{Name: name, ShortName: shortName, Usage: usage}
}
func (c *flagContext) NewStringSliceFlagWithDefault(name string, shortName string, usage string, value []string) {
c.cmdFlags[name] = &StringSliceFlag{Name: name, ShortName: shortName, Value: value, Usage: usage}
}