diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Main.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Main.java index 1c8cac311..b9fc33af9 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Main.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Main.java @@ -166,7 +166,7 @@ public final class Main files.add(new File(element)); } - if (files.isEmpty()) { + if (files.isEmpty() && !aLine.hasOption("r")) { System.out.println("Must specify files to process"); usage(); } diff --git a/src/xdocs/releasenotes.xml b/src/xdocs/releasenotes.xml index f06da0d24..997973a59 100755 --- a/src/xdocs/releasenotes.xml +++ b/src/xdocs/releasenotes.xml @@ -32,6 +32,12 @@ The NCSS complexity checker reported an incorrect fileMax value (bug #2161419). + +
  • + Checkstyle command-line no longer reports a usage error if the + user specifies a directory with the -r option that does + not contain any files. Thanks to Florian for patch #2151706. +
  • Notes: