aboutsummaryrefslogtreecommitdiff
path: root/string_slice.go
AgeCommit message (Collapse)Author
2019-09-17Merge pull request #216 from therealmitchconnors/elegantMitch Connors
Implement SliceValue for better list semantics
2019-09-10gofmttherealmitchconnors
2019-08-16Add first SliceValue implementationstherealmitchconnors
2019-02-11Fix descriptions for StringSlice functionsMike Fedosin
2018-02-20doc: clarify difference between string slice vs. array (#158)Michael Weibel
fixes #157
2016-10-23Clean up codebogem
2016-10-07fix bug of string_slice with square bracketsshenwei356
2016-09-06add a new type StringArraywu8685
2016-08-19Fix bug in FlagSet.GetStringSlice when a comma in a string slice valuewu8685
2016-08-03Fix string_slice with empty valueAntoine Pelisse
Currently, if you don't set any value for a StringSliceVar, it will end-up failing with an EOF error. It fails because the CSV parser for the value can't read anything. Special case when the string is empty to return an empty list.
2015-10-13Use encoding/csv to parse string slicesEric Paris
There was no way to escape or use a , in a string slice so use the encoding/csv library, rather than string.split() and let golang take care of the encoding issues.
2015-08-15Fix up minor things found by goreportcard.comEric Paris
2015-08-12Do not append to default values in {String,Int}SliceEric Paris
I added the ability to do: `-s=bob -s=john` and get `[]string{"bob", "john"}` But if a default value was set to say `[]string{"eric"}` the above operation was mistakenly resulting in: `[]string{"eric", "bob", "john"} which was obviously not what was intended. This is fixed by tracking if a value was parsed and overwriting the default on the first time -s is found, but we append the 2+ time.
2015-08-05Empty slices should be empty, not have a single (empty) stringEric Paris
2015-08-05String and Int slices called twice should append not overwriteEric Paris
This allows users to do things like ``` cmd --filename=file1 --filename=file2 --filename=file3,file4 ``` And internally we will get ``` []string{"file1", "file2", "file3", "file4"} ```
2015-08-05Show [] around string slices when showing the textEric Paris
This means things like autogenerated docs will show `--filename=[]` instead of just `--filename=`
2015-06-22Add new StringSlice flag typeEric Paris
Arguments passed on the command line will be split on "," and will be stored in a slice. We can see this already exits in codegangsta/cli https://github.com/codegangsta/cli/blob/44d40054fa6208a3013d7217aca72a2b8b0f5a0b/flag.go#L102 And people have written their own implementations for cobra/pflag https://github.com/GoogleCloudPlatform/kubernetes/blob/c5ba95ee26cbec9694a780544b559a797956ea54/pkg/util/list.go Lets just make it a first class flag