-
Notifications
You must be signed in to change notification settings - Fork 235
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
Bad wrapping of long character arguments #21
Comments
This is because we're using An initial thought would be to split the usage string on commas, compute the length of each string + 3 (for the comma and indent), compute cumulative sum and then break using modulo arithmetic. (Probably a bit too simple) |
And if the character string contains a comma? str_wrap does a pretty good job in general. Perhaps the best solution here is to override the default usage string 'by hand' with @Usage tag (and leave it 'untouch' by str_wrap in this case)? |
Another solution could be to format correctly the string inside the usage() function. A very ugly solution inspired by your comment:
|
Would you mind also supply a couple of test cases? (And I think you can simplify your code by doing |
Good point! Here it is:
Some tests:
I will try to include this in the package and to propose a real git patch this week end (I can't from my work computer). |
beside |
I've seen this commit |
@eusebe - that commit is unrelated to this problem. |
When there is a default argument of class character, there is sometimes a extra "\n" character in the \usage section which leads to a "Mismatches argument default value" warning in R CMD check.
R code:
\usage section:
Please not the newline for the 'c' argument.
R cmd check:
The text was updated successfully, but these errors were encountered: