-
Notifications
You must be signed in to change notification settings - Fork 418
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
Opaque stacktrace for "%" in Option description #615
Comments
Hi Peter, good catch, I did not realize this. What is happening is that picocli formats the description of all options to convert any embedded The drawback is that any @Option(names = {"--excludebase"}, arity="1..*",
description = "exclude child files of cTree (only works with --ctree). "
+ "Currently must be explicit or with trailing %% for truncated glob."
)
public String[] excludeBase; This will get rendered as a single This is documented partially but I should update the docs to explain that this is done for all option descriptions now, and I should make special mention of the fact that standalone |
That said, the obtuse stack trace is very undesirable. I’ll add some error handling around the formatting so that this becomes a warning instead and the unformatted usage help message is shown. |
Thank you!
and emit something to indicate that this is an illegal % (which should be escaped as %%) , and give the local text context (in " bla bla % foo bling ...") then most people can locate it and edit. |
… illegal format specifiers like single '%' characters.
… illegal format specifiers like single '%' characters.
I've pushed a fix to master that does this:
Can you verify? I still need to update the documentation so keeping this ticket open for now. |
Give me a day ...
…On Wed, Jan 30, 2019 at 11:34 PM Remko Popma ***@***.***> wrote:
I've pushed a fix to master that does this:
- if an illegal format exception occurs, catch it and use the raw
string instead (this means that embedded '%n' strings are not converted to
newlines)
- trace at WARN level to STDERR what happened and what users can do
about it.
Can you verify?
I still need to update the documentation so keeping this ticket open for
now.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#615 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAsxS4PWh_8dZCGKnPSd9OI_DRt_lVYjks5vIiv8gaJpZM4aYnIe>
.
--
Peter Murray-Rust
Founder ContentMine.org
and
Reader Emeritus in Molecular Informatics
Dept. Of Chemistry, University of Cambridge, CB2 1EW, UK
|
…rmat specifiers in javadoc for relevant @command, @option and @parameters annotation attributes Closes #615
Picocli 3.9.3 has been released. This includes a fix for this issue. Enjoy! |
If a naked percent character occurs in an option, a large and impenetrable stack trace is thrown.
gives
This is not easy to interpret. What are the rules for including "%" escaping and can the error be trapped more meaningfully?
The text was updated successfully, but these errors were encountered: