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

content format when missing required option #1443

Closed
kunlk opened this issue Oct 19, 2021 · 8 comments
Closed

content format when missing required option #1443

kunlk opened this issue Oct 19, 2021 · 8 comments
Milestone

Comments

@kunlk
Copy link

kunlk commented Oct 19, 2021

Hi,

This issue should be a question other than bug. Thank you for your help in advance !

The question is when one required option was missing, the usage out put doesn't display the command in one line.

For example as below, I expect that "synctl export -baselineselector= -loadrule= -snapath=" could be displayed in one line but it's wrapped.

c:\shared\vvctl>synctl.bat export -baselineselector wp_zxm_proj1_Int_0.12.0 -snapath C:\myview1
Missing required option '-loadrule='
export data
Usage: synctl export -baselineselector= -loadrule=
-snapath=
-baselineselector=
baseline selector name
-loadrule= load rule
-snapath=
snapshot path

@kunlk
Copy link
Author

kunlk commented Oct 19, 2021

In case the description doesn't clear, paste a screenshot

image

@remkop
Copy link
Owner

remkop commented Oct 19, 2021

Thanks, the screenshot helped!

By default the usage help width is 80 characters, but this is configurable:

see https://picocli.info/#_usage_width

@kunlk
Copy link
Author

kunlk commented Oct 19, 2021

Thanks @remkop, it works great. For the options lists below the usage line, is there a way to set the width too ? For example, the option lines for -baselineselector and -snapath break.

image

@remkop
Copy link
Owner

remkop commented Oct 19, 2021

@kunlk
Copy link
Author

kunlk commented Oct 19, 2021

HI @remkop , I am sorry, but I did not find the method setLongOptionsMaxWidth in CommandLine. I tried to set spec.usageMessage().longOptionsMaxWidth(120); but it did not help.

@remkop
Copy link
Owner

remkop commented Oct 19, 2021

Looks like I got the name of the CommandLine setter wrong in the documentation.
It should be setUsageHelpLongOptionsMaxWidth.

It needs to be set before the help is shown.

@kunlk
Copy link
Author

kunlk commented Oct 19, 2021

yes, it works perfect, thank you !

@remkop remkop closed this as completed in 3421ba6 Oct 19, 2021
@remkop
Copy link
Owner

remkop commented Oct 19, 2021

I fixed the user manual.
Thanks for raising this!

@remkop remkop added this to the 4.6.2 milestone Oct 19, 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