Skip to content
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

Handles rest arguments incorrectly? #153

Open
lishaduck opened this issue Feb 25, 2025 · 1 comment
Open

Handles rest arguments incorrectly? #153

lishaduck opened this issue Feb 25, 2025 · 1 comment

Comments

@lishaduck
Copy link

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 added a commit to LoganjdM/cu-fied that referenced this issue Feb 25, 2025
Drop C for now, it's tracked in Git and is a pain to compile.

Notably, this doesn't support multiple source files, see Hejsil/zig-clap#153.
@Hejsil
Copy link
Owner

Hejsil commented Feb 25, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants