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

Fix: repeated args should not append (but overwrite or ignore) if already have enough params #16

Closed
1 of 5 tasks
xparq opened this issue Jan 27, 2023 · 1 comment
Closed
1 of 5 tasks
Labels
bug Something isn't working

Comments

@xparq
Copy link
Owner

xparq commented Jan 27, 2023

With moons taking 1 param, args-test.exe --moons=11 --unknown=123 --moons=-99 is now incorrect:

NAMED:
moons = 11, -99
unknown = 123
  • The new moons should be ignored if it's a multi-value arg. and already has enough:

    --moons=1,2,3 --unknown=123 --moons=4,5 --moons=6

Should be 1, 2, 3 + error flags.
-> But... Now (after a ~year), however, I think the "it doesn't yet have enough..." case shouldn't actually be supported! -> #44 instead!

  • And it should overwrite if it's a single-val option.
    • Probably also, in general, if it takes a fixed number of params: --moons=1,2,3 --junk --moons=4,5,6?
  • But what to do if they are greedy: --moons=1,2 --junk --moons=3 -x --moons=4,5,6? Shouldn't this accumulate all the params then? I feel that greediness is a weaker factor, though, than consistency (with the other arities).

Actually...

  • There should just be a rule for this (similarly to arity), with Override as default, Append as an option...
@xparq xparq changed the title Fix: repeated args should not append (but overwrite of ignore) if already have enough params Fix: repeated args should not append (but overwrite or ignore) if already have enough params Jan 27, 2023
@xparq xparq added the bug Something isn't working label Jan 30, 2023
@xparq xparq pinned this issue Nov 2, 2023
@xparq xparq closed this as completed in b357093 Nov 2, 2023
@xparq xparq reopened this Nov 2, 2023
@xparq
Copy link
Owner Author

xparq commented Nov 2, 2023

Got closed prematurely: overriding --arg (by repeating it) only works if
a) no positional args follow --arg (to be repeated), or
b) --arg is defined to have fixed number of params!

@xparq xparq closed this as completed in dfbba86 Nov 3, 2023
xparq added a commit that referenced this issue Nov 3, 2023
@xparq xparq unpinned this issue Nov 3, 2023
@xparq xparq pinned this issue Nov 3, 2023
@xparq xparq unpinned this issue Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant