File tree Expand file tree Collapse file tree
src/java/org/apache/commons/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ public class HelpFormatter
140140 /**
141141 * Flag to determine if we try to determine terminal width
142142 */
143- public boolean autoWidth = false ;
143+ private boolean autoWidth = false ;
144144
145145 /**
146146 * Sets the 'width'.
@@ -702,7 +702,7 @@ private static String unixCmdOut(String program)
702702 String rstr ;
703703 ByteArrayOutputStream sout = new ByteArrayOutputStream ();
704704 try {
705- Process p = Runtime .getRuntime ().exec (new String [] {"sh" ,"-c" ,program });
705+ Process p = Runtime .getRuntime ().exec (new String [] {"/bin/ sh" ,"-c" ,program });
706706 in = p .getInputStream ();
707707 while ((c = in .read ()) != -1 ) {
708708 sout .write (c );
Original file line number Diff line number Diff line change 2525 <release version =" 1.3" date =" in SVN" >
2626 <action type =" add" dev =" jim" issue =" CLI-166" >
2727 HelpFormatter can now autodetect (if desired) terminal width under Unix.
28+ This is done via setAutoWidth(true) and the actual terminal width determination
29+ is done internally by calling "/bin/sh -c stty -a < /dev/null". If anything
30+ fails, the defaultWidth is used.
2831 </action >
2932 <action type =" add" dev =" ebourg" issue =" CLI-160" >
3033 PosixParser now supports partial long options (--ver instead of --version)
You can’t perform that action at this time.
0 commit comments