Permalink
Browse files

1st line wrapping: split hard on character position (than on words)

  • Loading branch information...
1 parent 91a37ef commit ce6164a7ae5d677f49d6eb3d6bfbc1449d66bbff jhm committed Jun 19, 2008
Showing with 28 additions and 4 deletions.
  1. +1 −1 .classpath
  2. +12 −0 .settings/org.eclipse.jdt.core.prefs
  3. +8 −2 args4j/src/org/kohsuke/args4j/CmdLineParser.java
  4. +7 −1 xdocs/changes.xml
View
@@ -5,8 +5,8 @@
<classpathentry kind="src" output="args4j/target/classes" path="args4j/src"/>
<classpathentry kind="src" output="args4j/target/test-classes" path="args4j/test"/>
<classpathentry kind="lib" path="args4j/lib/ant.jar"/>
- <classpathentry kind="lib" path="args4j/lib/junit.jar"/>
<classpathentry kind="lib" path="C:/jdk/150_14/lib/tools.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/150_14"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@@ -0,0 +1,12 @@
+#Wed Jun 18 20:01:43 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
@@ -338,8 +338,14 @@ private void printOption(PrintWriter out, OptionHandler handler, int len, Resour
List<String> rv = new ArrayList<String>();
String[] hardWrapedLines = line.split("\\n");
for (int i = 0; i < hardWrapedLines.length; i++) {
- // TODO: implement line wrapping, for the meantime: return the line unwrapped
- rv.add(hardWrapedLines[i]);
+ // TODO: implement real line wrapping.
+ //For the meantime: wrap hard on maxLength position
+ String restOfLine = hardWrapedLines[i];
+ while(restOfLine.length()>maxLength) {
+ rv.add(restOfLine.substring(0, maxLength));
+ restOfLine = restOfLine.substring(maxLength);
+ }
+ rv.add(hardWrapedLines[i]);
}
return rv;
}
View
@@ -6,7 +6,13 @@
<author email="marksinke@dev.java.net">Mark Sinke</author>
</properties>
<body>
- <release version="2.0.9" date="2008-??-??" description="Next version after a long time">
+ <release version="2.0.10">
+ <action dev="jhm" type="fix" issue="10">
+ Enum with many/long values result in StringIndexOutOfBoundsException CmdLineParser.printUsage / printOption
+ </action>
+ <action dev="jhm">Rewrite the printOptions with a hook for line wrapping on word borders</action>
+ </release>
+ <release version="2.0.9" date="2008-06-16" description="Next version after a long time">
<action dev="jhm" type="add">Support of all Java native types</action>
<action dev="jhm" type="add">Support of java.util.Map</action>
</release>

0 comments on commit ce6164a

Please sign in to comment.