@@ -367,7 +367,7 @@ public void setOptionComparator(Comparator comparator)
367367 */
368368 public void printHelp (String cmdLineSyntax , Options options )
369369 {
370- printHelp (defaultWidth , cmdLineSyntax , null , options , null , false );
370+ printHelp (getWidth () , cmdLineSyntax , null , options , null , false );
371371 }
372372
373373 /**
@@ -382,7 +382,7 @@ public void printHelp(String cmdLineSyntax, Options options)
382382 */
383383 public void printHelp (String cmdLineSyntax , Options options , boolean autoUsage )
384384 {
385- printHelp (defaultWidth , cmdLineSyntax , null , options , null , autoUsage );
385+ printHelp (getWidth () , cmdLineSyntax , null , options , null , autoUsage );
386386 }
387387
388388 /**
@@ -414,7 +414,7 @@ public void printHelp(String cmdLineSyntax, String header, Options options, Stri
414414 */
415415 public void printHelp (String cmdLineSyntax , String header , Options options , String footer , boolean autoUsage )
416416 {
417- printHelp (defaultWidth , cmdLineSyntax , header , options , footer , autoUsage );
417+ printHelp (getWidth () , cmdLineSyntax , header , options , footer , autoUsage );
418418 }
419419
420420 /**
@@ -451,7 +451,7 @@ public void printHelp(int width, String cmdLineSyntax, String header,
451451 {
452452 PrintWriter pw = new PrintWriter (System .out );
453453
454- printHelp (pw , width , cmdLineSyntax , header , options , defaultLeftPad , defaultDescPad , footer , autoUsage );
454+ printHelp (pw , width , cmdLineSyntax , header , options , getLeftPadding (), getDescPadding () , footer , autoUsage );
455455 pw .flush ();
456456 }
457457
@@ -541,7 +541,7 @@ public void printHelp(PrintWriter pw, int width, String cmdLineSyntax,
541541 public void printUsage (PrintWriter pw , int width , String app , Options options )
542542 {
543543 // initialise the string buffer
544- StringBuffer buff = new StringBuffer (defaultSyntaxPrefix ).append (app ).append (" " );
544+ StringBuffer buff = new StringBuffer (getSyntaxPrefix () ).append (app ).append (" " );
545545
546546 // create a list for processed option groups
547547 final Collection processedGroups = new ArrayList ();
@@ -679,7 +679,7 @@ public void printUsage(PrintWriter pw, int width, String cmdLineSyntax)
679679 {
680680 int argPos = cmdLineSyntax .indexOf (' ' ) + 1 ;
681681
682- printWrapped (pw , width , defaultSyntaxPrefix .length () + argPos , defaultSyntaxPrefix + cmdLineSyntax );
682+ printWrapped (pw , width , getSyntaxPrefix () .length () + argPos , getSyntaxPrefix () + cmdLineSyntax );
683683 }
684684
685685 /**
@@ -771,15 +771,15 @@ protected StringBuffer renderOptions(StringBuffer sb, int width, Options options
771771
772772 if (option .getOpt () == null )
773773 {
774- optBuf .append (lpad ).append (" " + defaultLongOptPrefix ).append (option .getLongOpt ());
774+ optBuf .append (lpad ).append (" " ). append ( getLongOptPrefix () ).append (option .getLongOpt ());
775775 }
776776 else
777777 {
778- optBuf .append (lpad ).append (defaultOptPrefix ).append (option .getOpt ());
778+ optBuf .append (lpad ).append (getOptPrefix () ).append (option .getOpt ());
779779
780780 if (option .hasLongOpt ())
781781 {
782- optBuf .append (',' ).append (defaultLongOptPrefix ).append (option .getLongOpt ());
782+ optBuf .append (',' ).append (getLongOptPrefix () ).append (option .getLongOpt ());
783783 }
784784 }
785785
@@ -827,7 +827,7 @@ protected StringBuffer renderOptions(StringBuffer sb, int width, Options options
827827
828828 if (i .hasNext ())
829829 {
830- sb .append (defaultNewLine );
830+ sb .append (getNewLine () );
831831 }
832832 }
833833
@@ -856,7 +856,7 @@ protected StringBuffer renderWrappedText(StringBuffer sb, int width,
856856
857857 return sb ;
858858 }
859- sb .append (rtrim (text .substring (0 , pos ))).append (defaultNewLine );
859+ sb .append (rtrim (text .substring (0 , pos ))).append (getNewLine () );
860860
861861 if (nextLineTabStop >= width )
862862 {
@@ -884,7 +884,7 @@ protected StringBuffer renderWrappedText(StringBuffer sb, int width,
884884 pos = width ;
885885 }
886886
887- sb .append (rtrim (text .substring (0 , pos ))).append (defaultNewLine );
887+ sb .append (rtrim (text .substring (0 , pos ))).append (getNewLine () );
888888 }
889889 }
890890
0 commit comments