Closed heysokam closed 3 months ago
Would this be something where you replace =
with :
, or allow both? Either way, I'm not against this being configurable with the default being status quo.
Could have an API like this:
var res = clap.parse(clap.Help, ¶ms, clap.parsers.default, .{
.diagnostic = &diag,
.allocator = gpa.allocator(),
.assignment_separators = "=:", // &.{ '=', ':' } Might be more readable :^)
});
Either allowing both by default or configurable. Whatever is easiest to implement, I don't mind too much.
As far as feasibility goes, only two lines of logic needs to be changed.
https://github.com/Hejsil/zig-clap/blob/master/clap/streaming.zig#L71 https://github.com/Hejsil/zig-clap/blob/master/clap/streaming.zig#L145
The rest of the changes will be passing around the assignment_separators
option.
Either allowing both by default or configurable.
I want to keep the current behavior as default, but allow for it to be configured.
@heysokam Have a look if this is what you had in mind ^
@Hejsil @heysokam Have a look if this is what you had in mind ^
That's epic, didn't know you would actually do it! Tysm :+1: :+1:
Hi there, First timer here, and in Zig
I'm used to Nim, where you can define variables like
--thing:val
, and I really like that syntax. Butzig-clap
doesn't seem to support it from what I've seen/understood so far. So I was wondering: How feasible would it be to extend the library to support it? Or would it just be rejected because of some design philosophy/choices?Curious what your thoughts are on the idea.