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

     1  package flags
     2  
     3  import "strconv"
     4  
     5  type Float64Flag struct {
     6  	Name      string
     7  	Value     float64
     8  	Usage     string
     9  	ShortName string
    10  	Hidden    bool
    11  }
    12  
    13  func (f *Float64Flag) Set(v string) {
    14  	i, _ := strconv.ParseFloat(v, 64)
    15  	f.Value = i
    16  }
    17  
    18  func (f *Float64Flag) String() string {
    19  	return f.Usage
    20  }
    21  
    22  func (f *Float64Flag) GetName() string {
    23  	return f.Name
    24  }
    25  
    26  func (f *Float64Flag) GetShortName() string {
    27  	return f.ShortName
    28  }
    29  
    30  func (f *Float64Flag) GetValue() interface{} {
    31  	return f.Value
    32  }
    33  
    34  func (f *Float64Flag) Visible() bool {
    35  	return !f.Hidden
    36  }