diff --git a/pmd/src/main/java/net/sourceforge/pmd/cli/PMDCommandLineInterface.java b/pmd/src/main/java/net/sourceforge/pmd/cli/PMDCommandLineInterface.java index 205f035b4e..94818e6baa 100644 --- a/pmd/src/main/java/net/sourceforge/pmd/cli/PMDCommandLineInterface.java +++ b/pmd/src/main/java/net/sourceforge/pmd/cli/PMDCommandLineInterface.java @@ -60,7 +60,7 @@ public class PMDCommandLineInterface { + "3) A ruleset filename or a comma-delimited string of ruleset filenames" + PMD.EOL + PMD.EOL + "For example: " + PMD.EOL - + "c:\\> " + launchCmd + " c:\\my\\source\\code html java-unusedcode" + PMD.EOL + + "c:\\> " + launchCmd + "-d c:\\my\\source\\code -f html -R java-unusedcode" + PMD.EOL + PMD.EOL; fullText += supportedVersions() + PMD.EOL; @@ -87,10 +87,10 @@ public class PMDCommandLineInterface { final String WINDOWS_PATH_TO_CODE = "c:\\my\\source\\code"; return "For example on windows: " + PMD.EOL - + WINDOWS_PROMPT + launchCmd + " -dir" + WINDOWS_PATH_TO_CODE + "-format text java-unusedcode,java-imports -version 1.5 -language java -debug" + PMD.EOL + + WINDOWS_PROMPT + launchCmd + " -dir" + WINDOWS_PATH_TO_CODE + "-format text -R java-unusedcode,java-imports -version 1.5 -language java -debug" + PMD.EOL + WINDOWS_PROMPT + launchCmd + " -dir" + WINDOWS_PATH_TO_CODE + "-f xml -rulesets java-basic,java-design -encoding UTF-8" + PMD.EOL + WINDOWS_PROMPT + launchCmd + " -d" + WINDOWS_PATH_TO_CODE + "-rulesets java-typeresolution -auxclasspath commons-collections.jar;derby.jar" + PMD.EOL - + WINDOWS_PROMPT + launchCmd + " -d" + WINDOWS_PATH_TO_CODE + "-f html java-typeresolution -auxclasspath file:///C:/my/classpathfile" + PMD.EOL + + WINDOWS_PROMPT + launchCmd + " -d" + WINDOWS_PATH_TO_CODE + "-f html -R java-typeresolution -auxclasspath -d file:///C:/my/classpathfile" + PMD.EOL + PMD.EOL; } diff --git a/pmd/src/site/xdocs/running.xml b/pmd/src/site/xdocs/running.xml index f418b9f5cc..6fbd8601ee 100644 --- a/pmd/src/site/xdocs/running.xml +++ b/pmd/src/site/xdocs/running.xml @@ -15,7 +15,7 @@

The first argument is the name of the utility you want to execute ('pmd', 'designer',...) and the other arguments are specific to the utility used.

-$ ./bin/run.sh pmd ../../../src/main/java/ text rulesets/java/basic.xml -version java 1.7 + $ ./bin/run.sh pmd -d ../../../src/main/java/ -f text -R rulesets/java/basic.xml -version 1.7 -language java .../src/main/java/net/sourceforge/pmd/RuleSet.java:123 These nested if statements could be combined .../src/main/java/net/sourceforge/pmd/RuleSet.java:231 Useless parentheses. .../src/main/java/net/sourceforge/pmd/RuleSet.java:232 Useless parentheses. @@ -29,7 +29,7 @@ $ ./bin/run.sh pmd ../../../src/main/java/ text rulesets/java/basic.xml -versio
  • Windows: Type "pmd [filename|jar or zip file containing source code|directory] [report format] [ruleset file]", i.e:

  • -C:\tmp\pmd-@VERSION@\pmd\bin>pmd c:\data\pmd\pmd\test-data\Unused1.java xml rulesets/java/unusedcode.xml +C:\tmp\pmd-@VERSION@\pmd\bin>pmd -d c:\data\pmd\pmd\test-data\Unused1.java -f xml -R rulesets/java/unusedcode.xml <?xml version="1.0"?><pmd> <file name="c:\data\pmd\pmd\test-data\Unused1.java"> <violation line="5" rule="UnusedLocalVariable"> @@ -47,16 +47,17 @@ C:\tmp\pmd-@VERSION@\pmd\bin>
  • If you want to run PMD without the batch file, you can do a:
  • -C:\tmp\pmd-@VERSION@\pmd>java -Djava.ext.dirs=lib +C:\tmp\pmd-@VERSION@\pmd>java -Djava.ext.dirs=lib net.sourceforge.pmd.PMD - c:\j2sdk1.4.1_01\src\java\lang xml - rulesets/java/imports.xml + -d c:\j2sdk1.4.1_01\src\java\lang + -f xml + -R rulesets/java/imports.xml
  • Linux: Type "./run.sh pmd [filename|jar or zip file containing source code|directory] [report format] [ruleset file]", i.e:

  • -/home/user/tmp/pmd-@VERSION@/pmd/bin>./run.sh pmd /home/user/data/pmd/pmd/test-data/Unused1.java xml rulesets/java/unusedcode.xml +/home/user/tmp/pmd-@VERSION@/pmd/bin>./run.sh pmd -d /home/user/data/pmd/pmd/test-data/Unused1.java -f xml -R rulesets/java/unusedcode.xml <?xml version="1.0"?><pmd> <file name="/home/user/data/pmd/pmd/test-data/Unused1.java"> <violation line="5" rule="UnusedLocalVariable"> @@ -69,47 +70,19 @@ Avoid unused local variables such as 'fr' - - +

    The tool comes with a rather extensive help text, simply running with --help !

    +

    PMD comes with four different renderer types: -