zig-clap icon indicating copy to clipboard operation
zig-clap copied to clipboard

Handles rest arguments incorrectly?

Open lishaduck opened this issue 10 months ago • 1 comments

I'm trying to implement mv in Zig, which means that the args I need to accept looks like this:

///<FILE>...
///<FILE>

Given mv a b c, this returns .{{a}, c}, rather than .{{a,b},c}. If I remove the second file, I get .{{a,b,c}}. It feels incorrect, but perhaps the recommended approach to just do one FILE? If that's the case, would you accept a PR to document that?

lishaduck avatar Feb 25 '25 02:02 lishaduck

Yea, this currently does not work and I'm not entirely sure how I would make it work with now clap parses positionals. A PR to document this limitation is welcome. Or, even better, make clap throw a compile error if anything but the last positional takes multiple values

Hejsil avatar Feb 25 '25 07:02 Hejsil