-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: cli-user driven delimiters #71
Comments
I do like the direction of this. There may be some details to figure out and possibly simplifications as I write it up. It had occurred to me to maybe require a delimiter to be in |
one design decision is whether to allow all 3
I'm leaning towards just allowing the 1st token ( |
Maybe your markdown just rendered weird, but what is Also, do you like the current single assignment semantics of clobbering with an explicit These are all relatively small questions compared to the overall idea, though. |
that was under assumption that other questions answered below |
I actually had forgotten about that subtely, and TBH I really don't like that there's a difference, it's surprising error prone behavior :) IMO:
should all be equivalent; furthermore, it shouldn't care whether
Note: for special case when there's no arg at all, there's debate whether to allow proposal: single argument
|
Note: I had initially thought of giving
whereas if |
Ah..Sorry about the confusion. I was mentally parsing that as a character in a syntactic position not as any amount of whitespace/os tokenization. The problem is that out in the wider world, repetition has been the only way/most common way to append, and appending is very commonly needed and supported while clobbering isn't (except for strings). I think we should target a situation where what people try first works as expected without looking at any documentation. Learning nothing at all is the least effort thing, even if that nothing is a kind of half capable/half consistent traditional CL syntax. It may seem like a little thing to you, but those dozen In short, having I hear you Re: I'm with you on So, |
ok, convinced. so I guess here's the final deal; please let me know if there's anything where you disagree in what follows:
semantics for string (instead of seq[string]):proc main(foo = "bar") = discard
noteone more thing: I think we should stick to chars that don't require shell quoting, so |
I agree with everything I see there, except |
(That naked non-bool |
And we probably want to use |
overall I'm quite happy with resulting syntax / semantics we're finally converging to! it's a unique mix of:
|
I get your In impl terms, Anyway, I should get to work re-coding all this now. I agree that it's a nice outcome that satisfies a lot of concerns. People also sometimes use |
Actually, I think I changed my mind about a missing argument to an option at the end of parameters. An empty argument is a valid one for several kinds of types. So, I think we should just set the val to be empty string and let the |
Ok. I think I got everything we outlined above (with the EOL missing equivalent to empty arg delta), but I would not be even a little surprised if I missed something. Give it a spin and let me know. We should probably add a bunch of other-than-just- |
(follow-up on #70 (comment))
one thing I never liked with current design is that cli author sets the delimiter; this may not match what cli user finds convenient, and is less explicit (should be clear if set by cli user)
How about the following:
proposal: cli-user driven delimiters
delimiter
indispatch
--foo@=
to clear a seq; it'll be handled via--foo,=
as a special case of multiargument syntax (namely, 0 arg), see below (helps discoverability!),
shall be interpreted as a regular char, eg:arg1,arg2
is a single entry)cligen automatically provides syntax sugar for delimiters; these are in DPSV format, always. The cligen author doesn't need to set anything to enable these.
each multiargument syntax starts with
,=
followed either 0 delimiter or 1 delimiter, a slight twist on your DPSV idea.benefits
\
, no strong opinion yet (see escaping delimiter for a seq[string] #70)--foo,=
that clears seq) and don't require escaping any delimiter, and for advanced user the multi-arg syntax sugar is always available (doesn't depend on cligen author enabling it)The text was updated successfully, but these errors were encountered: