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

keyValueMap should not prevent further parameters #226

Closed
senia-psm opened this issue Jul 14, 2023 · 4 comments · Fixed by #229
Closed

keyValueMap should not prevent further parameters #226

senia-psm opened this issue Jul 14, 2023 · 4 comments · Fixed by #229

Comments

@senia-psm
Copy link
Member

senia-psm commented Jul 14, 2023

The first usage option for keyValueMap is quite useful - -D key1=value -D key2=value.

But the second usage option -D key1=value key2=value prevents any further parameters.

This command fails with error:

-D key=value arg.

java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1

It would be more useful if we would be able to disable the second usage options.

Use case: docker -e ENV1=VAL1 -e ENV2=EVAL2 arg1 arg2

Reproducer: https://github.com/senia-psm/zio-cli-226

 $ ./bin/test --env a=b abc
timestamp=2023-07-14T16:30:17.631304859Z level=ERROR thread=#zio-fiber-1 message="" cause="Exception in thread "zio-fiber-4" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
        at zio.cli.Options$KeyValueMap.createMapEntry$1(Options.scala:475)
        at zio.cli.Options$KeyValueMap.createMapFromStringList$1$$anonfun$2(Options.scala:471)
@senia-psm senia-psm changed the title keyValueMap that does not prevent further parameters keyValueMap should not prevent further parameters Jul 14, 2023
@jdegoes
Copy link
Member

jdegoes commented Jul 15, 2023

/bounty $75

@algora-pbc
Copy link

algora-pbc bot commented Jul 15, 2023

💎 $75 bounty created by jdegoes
🙋 If you start working on this, comment /attempt #226 to notify everyone
👉 To claim this bounty, submit a pull request that includes the text /claim #226 somewhere in its body
📝 Before proceeding, please make sure you can receive payouts in your country
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to zio/zio-cli!

Attempt Started Solution
🟢 @ithinkicancode #229

@algora-pbc
Copy link

algora-pbc bot commented Jul 16, 2023

💡 @ithinkicancode submitted a pull request that claims the bounty. You can visit your org dashboard to reward.
👉 @ithinkicancode: To receive payouts, sign up on Algora, link your Github account and connect with Stripe on your dashboard.

@algora-pbc
Copy link

algora-pbc bot commented Jul 16, 2023

@ithinkicancode: Your claim has been rewarded! 👉 Complete your Algora onboarding to collect the bounty.

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

Successfully merging a pull request may close this issue.

2 participants