From 68f4136ecf4c77dccc4d7003f5020fafa4833534 Mon Sep 17 00:00:00 2001 From: therealmitchconnors Date: Tue, 10 Sep 2019 09:27:08 -0700 Subject: Add SliceValue Comments --- flag.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flag.go b/flag.go index 60c2038..e02abfe 100644 --- a/flag.go +++ b/flag.go @@ -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 } -- cgit v1.2.3