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

--help does not show subcommand description if there are any other parameters present #222

Open
senia-psm opened this issue Jul 7, 2023 · 5 comments
Assignees

Comments

@senia-psm
Copy link
Member

senia-psm commented Jul 7, 2023

Reproducer:

  private val param = Options.text("param")

  override def cliApp: CliApp[Any with ZIOAppArgs with Scope, Any, Any] =
    CliApp.make(
      "test",
      "0.1.0",
      HelpDoc.Span.text("Reproduce --help issue"),
      command = Command("test", param).subcommands(
        Command("a")
          .subcommands(
            Command("b")
          )
          .map { _ => () }
      )
    ) { _ => ZIO.unit    }

Expected behaviour: result for a --help and --param text a --help should be the same - help for a subcommand.

Actual result: --param text a --help shows root doc instead.

Correct result:

$ ./bin/test a --help
...

USAGE

  $ test a b

COMMANDS

  b  

Incorrect result:

$ ./bin/test --param text a --help
...
USAGE

  $ test --param text a b

OPTIONS

  --param text
    A user-defined piece of text.

COMMANDS

  a  

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

@jdegoes
Copy link
Member

jdegoes commented Jul 10, 2023

/bounty $100

@algora-pbc
Copy link

algora-pbc bot commented Jul 10, 2023

💎 $100 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #222 with your implementation plan
  2. Submit work: Create a pull request including /claim #222 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to zio/zio-cli!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @pablf #295

@ithinkicancode
Copy link
Contributor

@jdegoes @adamgfraser Please assign this to me.

@adamgfraser
Copy link
Contributor

@ithinkicancode Done!

Copy link

algora-pbc bot commented Feb 21, 2024

💡 @pablf submitted a pull request that claims the bounty. You can visit your bounty board to reward.

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.

4 participants