File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -199,16 +199,22 @@ func StringOption(names ...string) Option {
199
199
200
200
// StringsOption is a command option that can handle a slice of strings
201
201
func StringsOption (names ... string ) Option {
202
- return DelimitedStringsOption ("" , names ... )
202
+ return & stringsOption {
203
+ Option : NewOption (Strings , names ... ),
204
+ delimiter : "" ,
205
+ }
203
206
}
204
207
205
208
// DelimitedStringsOption like StringsOption is a command option that can handle a slice of strings.
206
209
// However, DelimitedStringsOption will automatically break up the associated CLI inputs based on the delimiter.
207
210
// For example, instead of passing `command --option=val1 --option=val2` you can pass `command --option=val1,val2` or
208
211
// even `command --option=val1,val2 --option=val3,val4`.
209
212
//
210
- // A delimiter of "" means that no delimiter is used
213
+ // A delimiter of "" is invalid
211
214
func DelimitedStringsOption (delimiter string , names ... string ) Option {
215
+ if delimiter == "" {
216
+ panic ("cannot create a DelimitedStringsOption with no delimiter" )
217
+ }
212
218
return & stringsOption {
213
219
Option : NewOption (Strings , names ... ),
214
220
delimiter : delimiter ,
You can’t perform that action at this time.
0 commit comments