Index: findbugs-2.0.2/src/java/edu/umd/cs/findbugs/ShowHelp.java
===================================================================
--- findbugs-2.0.2.orig/src/java/edu/umd/cs/findbugs/ShowHelp.java 2013-08-29 21:05:56.000000000 +0800
+++ findbugs-2.0.2/src/java/edu/umd/cs/findbugs/ShowHelp.java 2013-08-29 21:07:43.893829925 +0800
@@ -18,52 +18,59 @@
*/
package edu.umd.cs.findbugs;
-import java.util.TreeSet;
/**
* Show command line help.
- *
+ *
* @author David Hovemeyer
*/
public class ShowHelp {
-
+
public static void main(String[] args) {
System.out.println("FindBugs version " + Version.RELEASE + ", " + Version.WEBSITE);
-
+
DetectorFactoryCollection.instance();
- System.out.println("Command line options");
-
+ //System.out.println("Command line options");
+
+ /*
TreeSet<FindBugsMain> cmds = new TreeSet<FindBugsMain>();
- for(Plugin p : Plugin.getAllPlugins())
- for(FindBugsMain m : p.getAllFindBugsMain())
+ for(Plugin p : Plugin.getAllPlugins())
+ for(FindBugsMain m : p.getAllFindBugsMain())
cmds.add(m);
- for(FindBugsMain m : cmds)
- System.out.printf("fb %-12s %-12s %s%n", m.cmd, m.kind, m.description);
-
-// System.out.println();
-// System.out.println("GUI Options:");
-// FindBugsCommandLine guiCmd = new FindBugsCommandLine(true) {
-// };
-// guiCmd.printUsage(System.out);
-// System.out.println();
-// System.out.println("TextUI Options:");
-// FindBugs.showCommandLineOptions();
+ for(FindBugsMain m : cmds)
+ System.out.printf("fb %-12s %-12s %s%n", m.cmd, m.kind, m.description);
+ */
+ System.out.println();
+ showSynopsis();
+
System.out.println();
showGeneralOptions();
-
+
+ System.out.println();
+ System.out.println("GUI Options:");
+ FindBugsCommandLine guiCmd = new FindBugsCommandLine(true) {
+ };
+ guiCmd.printUsage(System.out);
+
+ System.out.println();
+ System.out.println("TextUI Options:");
+ FindBugs.showCommandLineOptions();
+ System.out.println();
+
}
public static void showSynopsis() {
System.out.println("Usage: findbugs [general options] [gui options]");
+ System.out.println(" or: findbugs [general options] -textui [textui options...] [jar/zip/class files, directories...]");
}
public static void showGeneralOptions() {
-
+
System.out.println("General options:");
System.out.println(" -jvmArgs args Pass args to JVM");
System.out.println(" -maxHeap size Maximum Java heap size in megabytes (default=768)");
System.out.println(" -javahome <dir> Specify location of JRE");
-
+
}
}
Index: findbugs-2.0.2/src/java/edu/umd/cs/findbugs/TextUICommandLine.java
===================================================================
--- findbugs-2.0.2.orig/src/java/edu/umd/cs/findbugs/TextUICommandLine.java 2013-08-29 21:05:56.000000000 +0800
+++ findbugs-2.0.2/src/java/edu/umd/cs/findbugs/TextUICommandLine.java 2013-08-29 21:07:37.913800267 +0800
@@ -145,7 +145,7 @@
public TextUICommandLine() {
addSwitch("-showPlugins", "show list of available detector plugins");
- startOptionGroup("Output options:");
+ startOptionGroup("\nOutput options:");
addSwitch("-justListOptions", "throw an exception that lists the provided options");
makeOptionUnlisted("-justListOptions");
@@ -177,7 +177,7 @@
makeOptionUnlisted("-outputFile");
addSwitchWithOptionalExtraPart("-nested", "true|false", "analyze nested jar/zip archives (default=true)");
- startOptionGroup("Output filtering options:");
+ startOptionGroup("\nOutput filtering options:");
addOption("-bugCategories", "cat1[,cat2...]", "only report bugs in given categories");
addOption("-onlyAnalyze", "classes/packages",
"only analyze given classes and packages; end with .* to indicate classes in a package, .- to indicate a package prefix");
@@ -186,14 +186,14 @@
addOption("-include", "filter file", "include only bugs matching given filter");
addSwitch("-applySuppression", "Exclude any bugs that match suppression filter loaded from fbp file");
- startOptionGroup("Detector (visitor) configuration options:");
+ startOptionGroup("\nDetector (visitor) configuration options:");
addOption("-visitors", "v1[,v2...]", "run only named visitors");
addOption("-omitVisitors", "v1[,v2...]", "omit named visitors");
addOption("-chooseVisitors", "+v1,-v2,...", "selectively enable/disable detectors");
addOption("-choosePlugins", "+p1,-p2,...", "selectively enable/disable plugins");
addOption("-adjustPriority", "v1=(raise|lower)[,...]", "raise/lower priority of warnings for given visitor(s)");
- startOptionGroup("Project configuration options:");
+ startOptionGroup("\nProject configuration options:");
addOption("-auxclasspath", "classpath", "set aux classpath for analysis");
addSwitch("-auxclasspathFromInput", "read aux classpath from standard input");
addOption("-sourcepath", "source path", "set source path for analyzed classes");