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

-- does not prevent options interpretation #225

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

-- does not prevent options interpretation #225

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

Comments

@senia-psm
Copy link
Member

senia-psm commented Jul 14, 2023

-- does not prevent options interpretation. So it is impossible to resolve ambiguous options vs args situation.

Reproducer:

private val opts = Options.text("abc")
private val args = Args.text("args").*

override def cliApp: CliApp[Any with ZIOAppArgs with Scope, Any, Any] =
  CliApp.make(
    "test",
    "0.1.0",
    HelpDoc.Span.text("Reproduce -- issue"),
    command = Command("test", opts.optional, args)
  ) { (opts, args) =>
    ZIO.debug(s"opts: $opts") *>
    ZIO.debug(s"args: $args")
  }

Command: ./bin/test -- --abc text

Expected result: empty options, args == List("--abc", "text").

Actual result:

$ ./bin/test -- --abc text
opts: Some(text)
args: List()

There is no way to convince the app that --abc is not an option name, but argument.

See reproducer here: https://github.com/senia-psm/zio-cli-225

@jdegoes
Copy link
Member

jdegoes commented Jul 15, 2023

/bounty $100

@algora-pbc
Copy link

algora-pbc bot commented Jul 15, 2023

💎 $100 bounty created by jdegoes
🙋 If you start working on this, comment /attempt #225 to notify everyone
👉 To claim this bounty, submit a pull request that includes the text /claim #225 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
🟢 @vigoo #228

@algora-pbc
Copy link

algora-pbc bot commented Jul 15, 2023

💡 @vigoo submitted a pull request that claims the bounty. You can visit your org dashboard to reward.

@algora-pbc
Copy link

algora-pbc bot commented Jul 16, 2023

🎉🎈 @vigoo has been awarded $100! 🎈🎊

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