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

Text not alligned #1325

Closed
nomemory opened this issue Feb 12, 2021 · 4 comments
Closed

Text not alligned #1325

nomemory opened this issue Feb 12, 2021 · 4 comments

Comments

@nomemory
Copy link

I have written a Java script (not! javasceript), that I run using jbang. I use of course this lovely library.

The code of the script can be found here (it's big enough not to copy paste it).

Everything works ok, but I run --help, some of the options are misaligned in my terminal:

Usage: hr_schema [-hV] [-e=<numEmployees>] [-l=<numLocations>]
                 [-m=<numManagers>] [-ms=<minSalary>] [-Ms=<maxSalary>]
                 [-t=<target>]
Script to generate SQL Inserts for HR Schema
  -e, --employees=<numEmployees>
                          The number of employees to be generated
                            Default: 1000
  -h, --help              Show this help message and exit.
  -l, --locations=<numLocations>
                          The number of locations to be generated
                            Default: 100
  -m, --managers=<numManagers>
                          The maximum number of managers.
                            Default: 50
      -ms, --min-salary=<minSalary>
                          The minimum salary an employee can get
                            Default: 1000
      -Ms, --max-salary=<maxSalary>
                          The maximum salary an employee can get
                            Default: 15000
  -t, --target=<target>   The target database. Supported options: mysql |
                            postgresql
                            Default: mysql
  -V, --version           Print version information and exit.

The -ms and the -Ms options are tabbed to the right. Am I doing something wrong?

This is, of course, a minor visual problem but anyway, any suggestions?

@remkop
Copy link
Owner

remkop commented Feb 12, 2021

Hi @nomemory, glad to hear you like picocli!

Yes, these options have more than one character, so picocli does not consider them POSIX (clusterable) options.
See this part in the manual: https://picocli.info/#_short_posix_options

If you change -ms to -s and change -Ms to -M, then they should lign up in the options list.

@remkop
Copy link
Owner

remkop commented Feb 12, 2021

This question has come up a few times now.
Do you have any suggestions for improving the documentation? (Like, which section would you expect to find the answer?)

@nomemory
Copy link
Author

To be honest, the documentation is rock-solid, but maybe a small mention here, after this paragraph:

Picocli supports POSIX clustered short options: one or more single-character options without option-arguments, followed by at most one option with an option-argument, can be grouped behind one '-' delimiter.

To reinforce what you've just told me, won't hurt.

@remkop
Copy link
Owner

remkop commented Feb 14, 2021

Cool.

I added a section to the user manual, but have not updated the rendered HTML yet.
This will go live with the next picocli release.

Thanks for raising this!

@remkop remkop closed this as completed Feb 14, 2021
@remkop remkop added this to the 4.7 milestone Feb 14, 2021
@remkop remkop modified the milestones: 4.7, 4.6.2 Feb 23, 2021
MarkoMackic pushed a commit to MarkoMackic/picocli that referenced this issue Oct 17, 2021
MarkoMackic added a commit to MarkoMackic/picocli that referenced this issue Oct 17, 2021
MarkoMackic added a commit to MarkoMackic/picocli that referenced this issue Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants