github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/flags/flag_constructor.go (about)

     1  package flags
     2  
     3  func (c *flagContext) NewStringFlag(name string, shortName string, usage string) {
     4  	c.cmdFlags[name] = &StringFlag{Name: name, ShortName: shortName, Usage: usage}
     5  }
     6  
     7  func (c *flagContext) NewStringFlagWithDefault(name string, shortName string, usage string, value string) {
     8  	c.cmdFlags[name] = &StringFlag{Name: name, ShortName: shortName, Value: value, Usage: usage}
     9  }
    10  
    11  func (c *flagContext) NewBoolFlag(name string, shortName string, usage string) {
    12  	c.cmdFlags[name] = &BoolFlag{Name: name, ShortName: shortName, Usage: usage}
    13  }
    14  
    15  func (c *flagContext) NewIntFlag(name string, shortName string, usage string) {
    16  	c.cmdFlags[name] = &IntFlag{Name: name, ShortName: shortName, Usage: usage}
    17  }
    18  
    19  func (c *flagContext) NewIntFlagWithDefault(name string, shortName string, usage string, value int) {
    20  	c.cmdFlags[name] = &IntFlag{Name: name, ShortName: shortName, Value: value, Usage: usage}
    21  }
    22  
    23  func (c *flagContext) NewFloat64Flag(name string, shortName string, usage string) {
    24  	c.cmdFlags[name] = &Float64Flag{Name: name, ShortName: shortName, Usage: usage}
    25  }
    26  
    27  func (c *flagContext) NewFloat64FlagWithDefault(name string, shortName string, usage string, value float64) {
    28  	c.cmdFlags[name] = &Float64Flag{Name: name, ShortName: shortName, Value: value, Usage: usage}
    29  }
    30  
    31  func (c *flagContext) NewStringSliceFlag(name string, shortName string, usage string) {
    32  	c.cmdFlags[name] = &StringSliceFlag{Name: name, ShortName: shortName, Usage: usage}
    33  }
    34  
    35  func (c *flagContext) NewStringSliceFlagWithDefault(name string, shortName string, usage string, value []string) {
    36  	c.cmdFlags[name] = &StringSliceFlag{Name: name, ShortName: shortName, Value: value, Usage: usage}
    37  }
    38  
    39  func (c *flagContext) NewBackwardsCompatibilityFlag(name string, shortName string, usage string) {
    40  	c.cmdFlags["name"] = &BackwardsCompatibilityFlag{}
    41  }