Skip to content

Commit

Permalink
Fix recursive flag and update help description to show link to JBoss …
Browse files Browse the repository at this point in the history
…Forge
  • Loading branch information
lincolnthree committed Sep 22, 2014
1 parent 309f49e commit fa198d8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions dist/src/main/java/org/jboss/forge/roaster/Bootstrap.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.jboss.forge.roaster;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -90,13 +91,20 @@ else if (new File(arg).exists())
}
}

private void format(List<File> files, String configFile, boolean recursive) throws IOException
private void format(List<File> files, String configFile, final boolean recursive) throws IOException
{
for (File file : files)
{
if (file.isDirectory())
{
format(Arrays.asList(file.listFiles()), configFile, recursive);
format(Arrays.asList(file.listFiles(new FileFilter()
{
@Override
public boolean accept(File file)
{
return recursive || file.isFile();
}
})), configFile, recursive);
}
else if (file.getName().endsWith(".java"))
{
Expand All @@ -112,7 +120,7 @@ private String help()
{
StringBuilder sb = new StringBuilder();
sb.append("Usage: roaster [OPTION]... FILES ... \n");
sb.append("The simplest command-line Java code formatter.\n");
sb.append("The simplest command-line Java code formatter. A JBoss Forge sub-project: http://forge.jboss.org\n");
sb.append("\n");
sb.append("-c, --config [CONFIG_FILE]\n");
sb.append("\t specify the path to the Eclipse code format profile (usually found at '$PROJECT/.settings/org.eclipse.jdt.core.prefs') \n");
Expand Down

0 comments on commit fa198d8

Please sign in to comment.