Defaults for slices #382
Unanswered
JesseOlmer
asked this question in
Q&A
Replies: 1 comment
-
Slice defaults with multiple values do indeed only work with flags at the moment. I think this is because flags support I'm not sure what the right solution here is really, syntactically. It wouldn't be logical to allow Strs []string `arg:"" default:"foo bar"` One option might be be to support multiple invocations of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There doesn't appear to be a way to set a default slice, as the package tries to parse as the base element type (at least for a positional argument). Is there a way to support this, even with a workaround of some kind? I'd like to be able to differentiate from having to set a default vs a user having sent in some kind of (potentially invalid) value, if possible.
error: [<ints> ...]: expected a valid 64 bit int but got "1,2,3"
Beta Was this translation helpful? Give feedback.
All reactions