Claudenw commented on code in PR #277:
URL: https://github.com/apache/commons-cli/pull/277#discussion_r1605795923


##########
src/main/java/org/apache/commons/cli/HelpFormatter.java:
##########
@@ -129,6 +129,14 @@ public Builder setShowDeprecated(final boolean 
useDefaultFormat) {
         }
     }
 
+    /**
+     * Returns the option description or an empty string if the description is 
{@code null}.
+     * @param option The option to get the description from.
+     * @return the option description or an empty string if the description is 
{@code null}.
+     */
+    public static String getDescription(final Option option) {
+        return option.getDescription() == null ? "" : option.getDescription();

Review Comment:
   I know we don't want to pull in the text utilities here but .... It feels 
like we do this sort of thing a number of times.  In the case that we do 
implement the same checks multiple times, would it make sense to bring in a 
striped down StringUtils?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to