Replies: 2 comments 4 replies
-
|
See also jdx/mise#4320 jdx/mise#4320 |
Beta Was this translation helpful? Give feedback.
0 replies
-
agreed
I think that's the only correct way to handle multiple with kdl so it has to be that. That said, I think we should also support |
Beta Was this translation helpful? Give feedback.
4 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.
-
Question: Given spec,
What should the parsed type of
foobe, assuming user didn't provide the flag on cli? (I believe the same question applies toarg/flagtoo)Today,
usagesays the default is a string"bar"(so it literally sends aStringtype as parse output when user doesn't provide the flag on the CLI). But when user does specify--foo abc --foo defor even just--foo pqr, it suddenly becomes a multistring (["abc", "def"]or["pqr"]). This creates a mismatch.IMO,
usageshould considervarwhen deciding the types ofdefaultreturn values, and always return a vec in this case.Now the question becomes, how do we specify a list of array values as the default in the spec. Reading KDL language spec, it seems the correct way would be-
In case the user only provides
default="bar", we should convert it to a singleton array,["bar"]so that it matches the runtime behavior in case the user does specify a single CLI arg.Relevancy: While less important in shell scripts, this is extremely important to pin down for
misebecause the args are used in Tera, and we would like to support 1:1 mapping from usageMultiStringto a TeraVec<String>. See jdx/mise#7041Beta Was this translation helpful? Give feedback.
All reactions