From 25ffe7a2c2b866750ed52b2fd1addef1652f1fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 16 Oct 2022 23:45:27 -0300 Subject: [PATCH] Make sure cpd docs reflect this too --- docs/pages/7_0_0_release_notes.md | 12 +++++++++++- docs/pages/pmd/userdocs/installation.md | 13 ++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/docs/pages/7_0_0_release_notes.md b/docs/pages/7_0_0_release_notes.md index 8c918fb25c..ba6d3a91fe 100644 --- a/docs/pages/7_0_0_release_notes.md +++ b/docs/pages/7_0_0_release_notes.md @@ -58,7 +58,17 @@ or even better, omit using `-d` / `--dir` and simply pass the sources at the end pmd check -R ruleset.xml src ``` -Additionally, the CLI has been enhanced with a progress bar, which interactively displays the +Multiple source directories can passed, such as: +```shell +pmd check -R ruleset.xml src/main/java src/test/java +``` + +And the exact same applies to CPD: +```shell +pmd cpd --minimum-tokens 100 src/main/java +``` + +Additionally, the CLI for the `check` command has been enhanced with a progress bar, which interactively displays the current progress of the analysis. TODO screenshot (take it right before releasing, because other changes to the CLI will occur until then) diff --git a/docs/pages/pmd/userdocs/installation.md b/docs/pages/pmd/userdocs/installation.md index 325fa7503e..7d4d8c8d4c 100644 --- a/docs/pages/pmd/userdocs/installation.md +++ b/docs/pages/pmd/userdocs/installation.md @@ -100,7 +100,7 @@ Additionally, the following options, are specified most of the time even though .../src/main/java/com/me/RuleSet.java:232 Useless parentheses. .../src/main/java/com/me/RuleSet.java:357 These nested if statements could be combined .../src/main/java/com/me/RuleSetWriter.java:66 Avoid empty catch blocks" - windows="pmd.bat check -d ..\..\src\main\java\ -f text -R rulesets/java/quickstart.xml + windows="pmd.bat check -f text -R rulesets/java/quickstart.xml ..\..\src\main\java\ .../src/main/java/com/me/RuleSet.java:123 These nested if statements could be combined .../src/main/java/com/me/RuleSet.java:231 Useless parentheses. @@ -114,12 +114,11 @@ Additionally, the following options, are specified most of the time even though content="CPD supports Java, JSP, C, C++, C#, Fortran and PHP source code, among other languages. For the full list, see [Supported Languages](pmd_userdocs_cpd.html#supported-languages)." %} -Like for PMD, CPD is started on Unix by `pmd cpd` and on Windows by `pmd.bat cpd`. +Like for PMD, CPD is started on Unix by `pmd cpd` and on Windows by `pmd.bat cpd`, and it requires one option and a list of sources: -There are two required parameters: -* `--files `: path to the sources to analyse. This can be a file name, a - directory or a jar or zip file containing the sources. * `--minimum-tokens `: the minimum token length which should be reported as a duplicate. +* ` …`: path to the sources to analyse. This can be a file name, a directory, or a jar or zip file containing the +sources. Alternatively You can use the `-d` or `--dir` flag, which is equivalent. {% include tip.html content="CPD's command-line reference, Ant task usage, and many examples are documented in the @@ -131,7 +130,7 @@ There are two required parameters: {% include cli_example.html id="cpd" - linux="pmd cpd --minimum-tokens 100 --files /home/me/src + linux="pmd cpd --minimum-tokens 100 /home/me/src Found a 7 line (110 tokens) duplication in the following files: Starting at line 579 of /home/me/src/test/java/foo/FooTypeTest.java @@ -144,7 +143,7 @@ There are two required parameters: assertEquals(Boolean.TYPE, expressions.get(index++).getType()); assertEquals(Boolean.TYPE, expressions.get(index++).getType()); assertEquals(Boolean.TYPE, expressions.get(index++).getType());" - windows="pmd.bat cpd --minimum-tokens 100 --files /home/me/src + windows="pmd.bat cpd --minimum-tokens 100 /home/me/src Found a 7 line (110 tokens) duplication in the following files: Starting at line 579 of c:\temp\src\test\java\foo\FooTypeTest.java