github.com/jenspinney/cli@v6.42.1-0.20190207184520-7450c600020e+incompatible/cf/flags/stringSlice.go (about)

     1  package flags
     2  
     3  //StringSlice flag can be define multiple times in the arguments
     4  type StringSliceFlag struct {
     5  	Name      string
     6  	Value     []string
     7  	Usage     string
     8  	ShortName string
     9  	Hidden    bool
    10  }
    11  
    12  func (f *StringSliceFlag) Set(v string) {
    13  	f.Value = append(f.Value, v)
    14  }
    15  
    16  func (f *StringSliceFlag) String() string {
    17  	return f.Usage
    18  }
    19  
    20  func (f *StringSliceFlag) GetName() string {
    21  	return f.Name
    22  }
    23  
    24  func (f *StringSliceFlag) GetShortName() string {
    25  	return f.ShortName
    26  }
    27  
    28  func (f *StringSliceFlag) GetValue() interface{} {
    29  	return f.Value
    30  }
    31  
    32  func (f *StringSliceFlag) Visible() bool {
    33  	return !f.Hidden
    34  }