You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there doesn't appear to be a way to specify a delimiter to use to split the provided strings into the string slice. For instance, if the above flag is specified:
./program -s one,two -s three
Results in:
0: one,two
1: three
Instead of:
0: one
1: two
2: three
The typical way to do this is to specify -s multiple times. Adding the ability to split the arguments by a delimiter would be a big usability improvement, particularly when you need to specify many arguments into that slice.
There currently is the env-delim option which appears to have a similar functionality. I propose to add a delim option that will split the flag values by the given delimiter.
The text was updated successfully, but these errors were encountered:
pazderak
pushed a commit
to pazderak/go-flags
that referenced
this issue
Oct 19, 2017
Also, I would personally add a size tag that would enforce slice (or maybe additionally, string size) arguments. Could be a range or a single integer.
e.g.
size:"3"
size:"1,-"
size:"-,4"
size"3,5"
When specifying a slice flag:
there doesn't appear to be a way to specify a delimiter to use to split the provided strings into the string slice. For instance, if the above flag is specified:
Results in:
Instead of:
The typical way to do this is to specify
-s
multiple times. Adding the ability to split the arguments by a delimiter would be a big usability improvement, particularly when you need to specify many arguments into that slice.There currently is the
env-delim
option which appears to have a similar functionality. I propose to add adelim
option that will split the flag values by the given delimiter.The text was updated successfully, but these errors were encountered: