Skip to content

Commit

Permalink
Add SliceValue Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
therealmitchconnors committed Sep 10, 2019
1 parent b22fc70 commit 68f4136
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,15 @@ type Value interface {
Type() string
}

// SliceValue is a secondary interface to all flags which hold a list
// of values. This allows full control over the value of list flags,
// and avoids complicated marshalling and unmarshalling to csv.
type SliceValue interface {
// Append adds the specified value to the end of the flag value list.
Append(string) error
// Replace will fully overwrite any data currently in the flag value list.
Replace([]string) error
// GetSlice returns the flag value list as an array of strings.
GetSlice() []string
}

Expand Down

0 comments on commit 68f4136

Please sign in to comment.