2929import java .util .Iterator ;
3030import java .util .List ;
3131
32- /**
32+ /**
3333 * A formatter of help messages for the current command line options
3434 *
3535 * @author Slawek Zachcial
@@ -331,7 +331,7 @@ public String getArgName()
331331 /**
332332 * Comparator used to sort the options when they output in help text.
333333 * Defaults to case-insensitive alphabetical sorting by option key.
334- *
334+ *
335335 * @since 1.2
336336 */
337337 public Comparator <Option > getOptionComparator ()
@@ -342,7 +342,7 @@ public Comparator<Option> getOptionComparator()
342342 /**
343343 * Set the comparator used to sort the options when they output in help text.
344344 * Passing in a null comparator will keep the options in the order they were declared.
345- *
345+ *
346346 * @since 1.2
347347 */
348348 public void setOptionComparator (Comparator <Option > comparator )
@@ -549,7 +549,7 @@ public void printUsage(PrintWriter pw, int width, String app, Options options)
549549 {
550550 // get the next Option
551551 Option option = (Option ) i .next ();
552-
552+
553553 // check if the option is part of an OptionGroup
554554 OptionGroup group = options .getOptionGroup (option );
555555
@@ -662,7 +662,7 @@ private void appendOption(final StringBuffer buff, final Option option, final bo
662662 buff .append ("]" );
663663 }
664664 }
665-
665+
666666 /**
667667 * Print the cmdLineSyntax to the specified writer, using the
668668 * specified width.
@@ -754,18 +754,18 @@ protected StringBuffer renderOptions(StringBuffer sb, int width, Options options
754754 // sort options ascending
755755 int max = 0 ;
756756 List <StringBuffer > prefixList = new ArrayList <StringBuffer >();
757-
757+
758758 List <Option > optList = options .helpOptions ();
759-
759+
760760 if (getOptionComparator () != null )
761761 {
762762 Collections .sort (optList , getOptionComparator ());
763763 }
764-
764+
765765 for (Option option : optList )
766766 {
767767 StringBuffer optBuf = new StringBuffer ();
768-
768+
769769 if (option .getOpt () == null )
770770 {
771771 optBuf .append (lpad ).append (" " ).append (getLongOptPrefix ()).append (option .getLongOpt ());
@@ -875,7 +875,7 @@ protected StringBuffer renderWrappedText(StringBuffer sb, int width,
875875
876876 return sb ;
877877 }
878-
878+
879879 if ((text .length () > width ) && (pos == nextLineTabStop - 1 ))
880880 {
881881 pos = width ;
@@ -888,7 +888,7 @@ protected StringBuffer renderWrappedText(StringBuffer sb, int width,
888888 /**
889889 * Render the specified text width a maximum width. This method differs
890890 * from renderWrappedText by not removing leading spaces after a new line.
891- *
891+ *
892892 * @param sb The StringBuffer to place the rendered text into.
893893 * @param width The number of characters to display per line
894894 * @param nextLineTabStop The position on the next line for the first tab.
@@ -939,7 +939,7 @@ private StringBuffer renderWrappedTextBlock(StringBuffer sb, int width, int next
939939 protected int findWrapPos (String text , int width , int startPos )
940940 {
941941 int pos ;
942-
942+
943943 // the line ends before the max wrap pos or a new line char found
944944 if (((pos = text .indexOf ('\n' , startPos )) != -1 && pos <= width )
945945 || ((pos = text .indexOf ('\t' , startPos )) != -1 && pos <= width ))
@@ -968,10 +968,10 @@ else if (startPos + width >= text.length())
968968 {
969969 return pos ;
970970 }
971-
971+
972972 // if we didn't find one, simply chop at startPos+width
973973 pos = startPos + width ;
974-
974+
975975 return pos == text .length () ? -1 : pos ;
976976 }
977977
@@ -986,7 +986,7 @@ protected String createPadding(int len)
986986 {
987987 char [] padding = new char [len ];
988988 Arrays .fill (padding , ' ' );
989-
989+
990990 return new String (padding );
991991 }
992992
0 commit comments