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

Clikt doesn't print the correct help upon subcommand parse failure #47

Closed
octylFractal opened this issue Jan 16, 2019 · 3 comments
Closed

Comments

@octylFractal
Copy link

octylFractal commented Jan 16, 2019

If I make a subcommand (e.g. sub) with a required argument, and then do ./tool sub, it prints the following:

Usage: tool [OPTIONS] COMMAND [ARGS]...

Error: Missing argument "ARGUMENT".

The usage printed is for the main command, but the error concerns the subcommand. It's not immediately clear that the argument missing actually belongs to the subcommand, unless you do ./tool sub -h:

Usage: sub [OPTIONS] ARGUMENT

<help omitted>

Options:
  -h, --help  Show this message and exit

I think this should be changed to it's clear where the argument is coming from.

@ajalt
Copy link
Owner

ajalt commented Jan 16, 2019

So in that case, you'd like it to print this?

Usage: sub [OPTIONS] ARGUMENT

Error: Missing argument "ARGUMENT".

@octylFractal
Copy link
Author

octylFractal commented Jan 16, 2019

Specifically, I'd like it to use the same usage string as in the help: Usage: sub [OPTIONS] ARGUMENT (ninja'd!)

Yes, that's exactly what I'm looking for.

@ajalt
Copy link
Owner

ajalt commented Jan 16, 2019

Yeah, that's definitely more clear.

@ajalt ajalt closed this as completed in 0a1589a Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants