Set custom text width for usage
Invoking usage() always seems to return/print a string wrapped at 80.
Can we set our own wrapping for this?
Hi @theonlygusti,
according to @cbeust if you want to have a custom usage you can write your own.
Especially in easy cases (without @Command sub-objects) that should be quite easy with parsing the existing annotations.
Best,
JS
@jeremysolarz, your suggestion doesn't fix the problem:
I like that the default usage goes through all defined commands/options/etc. and prints them all.
From what I understand, to incorporate this into my own usage, if I were to write it myself, this would be very difficult, as every time I created a new command, option, etc. I'd have to add it to the usage manually.
I feel like custom-width wrapping shouldn't be very difficult to add as some core functionality and it seems almost a must from a usability perspective.
@theonlygusti correct meant @Parameters of course.
For anyone else who might be running into this, too: The default column width of 79 chars is actually configurable via JCommander.setColumnSize.
Thanks @tze for finding this. Than we can close this ticket.
Thanks @tze. Here is a new permalink for setColumnSize