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

Feature request: Different description based on display context #429

Closed
bbottema opened this issue Aug 4, 2018 · 3 comments
Closed

Feature request: Different description based on display context #429

bbottema opened this issue Aug 4, 2018 · 3 comments

Comments

@bbottema
Copy link
Contributor

bbottema commented Aug 4, 2018

Hey @remkop, awesome library! Such granular control, yet I still need more (or I'm doing it wrong) :)

Ok, so here's my case: I'm generating my CLI command tree using the programmatic API (thanks for including that btw), but I have two description types: an abbreviated one and an elaborate man-page kind of description.

I would like to use the abbreviated description for commands when listed as sub commands under Commands:, and the man-page-like description when --help is triggered directly on the command.

Is it possible to do this?

@bbottema
Copy link
Contributor Author

bbottema commented Aug 4, 2018

Also, I couldn't find any documentation on how multiple descriptions are handled by picocli rather than a single one with newlines in it.
I discovered I can replace newlines by having multiple descriptions in the description array, but in the Command: listing then, only the first description from the array is shown, which is not the behavior I'm looking for (I expected all descriptions to be rendered).

@remkop
Copy link
Owner

remkop commented Aug 4, 2018

Hi, picocli already shows a different description based on display context: only the first line of the header or description (header if both are defined) is shown in the subcommands listing as the brief description for each subcommand.

As for adding documentation for embedded newlines, I need to take another look.
If you are able to provide a pull request to improve the documentation that would be great!

@bbottema
Copy link
Contributor Author

bbottema commented Aug 5, 2018

picocli already shows a different description based on display context: only the first line of the header or description (header if both are defined) is shown in the subcommands listing as the brief description for each subcommand.

If #430 is solved, then yes, perfect. Going to test your change now...

@bbottema bbottema closed this as completed Aug 5, 2018
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