Skip to content

-- does not prevent options interpretation #225

@senia-psm

Description

@senia-psm

-- 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions