aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc R. Hoffmann <hoffmann@mountainminds.com>2017-05-02 22:14:56 +0200
committerMarc R. Hoffmann <hoffmann@mountainminds.com>2017-05-02 22:14:56 +0200
commit5653302c6febde3d8f507bcf8b1778fe1b6bbebc (patch)
treeefed600c6bb46322c1183d01b929b9b33f533f60
parent9207225cf95ad44ddffbfb2a467e4c2eddf8c809 (diff)
downloadjacoco-5653302c6febde3d8f507bcf8b1778fe1b6bbebc.tar.gz
Use -dest for option name as output can be folder or file.
-rw-r--r--org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java10
-rw-r--r--org.jacoco.cli/src/org/jacoco/cli/internal/commands/Instrument.java8
2 files changed, 9 insertions, 9 deletions
diff --git a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java
index 7ea8b5c1..8cf041c3 100644
--- a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java
+++ b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java
@@ -46,7 +46,7 @@ public class InstrumentTest extends CommandTestBase {
public void shouldPrintUsage_whenNoArgumentsGiven() throws Exception {
execute("instrument");
assertFailure();
- assertContains("Option \"-destdir\" is required", err);
+ assertContains("Option \"-dest\" is required", err);
assertContains(
"Usage: java -jar jacococli.jar instrument [<sourcefiles> ...]",
err);
@@ -56,7 +56,7 @@ public class InstrumentTest extends CommandTestBase {
public void shouldInstrumentClassFiles() throws Exception {
File destdir = tmp.getRoot();
- execute("instrument", "-destdir", destdir.getAbsolutePath(),
+ execute("instrument", "-dest", destdir.getAbsolutePath(),
getClassPath());
assertOk();
@@ -75,7 +75,7 @@ public class InstrumentTest extends CommandTestBase {
throws Exception {
File destdir = tmp.getRoot();
- execute("instrument", "-destdir", destdir.getAbsolutePath());
+ execute("instrument", "-dest", destdir.getAbsolutePath());
assertOk();
assertArrayEquals(new String[0], destdir.list());
@@ -86,7 +86,7 @@ public class InstrumentTest extends CommandTestBase {
throws Exception {
File srcdir = new File(tmp.getRoot(), "src");
srcdir.mkdir();
- File destdir = new File(tmp.getRoot(), "sdest");
+ File destdir = new File(tmp.getRoot(), "dest");
destdir.mkdir();
OutputStream out = new FileOutputStream(
@@ -102,7 +102,7 @@ public class InstrumentTest extends CommandTestBase {
out.close();
try {
- execute("instrument", "-destdir", destdir.getAbsolutePath(),
+ execute("instrument", "-dest", destdir.getAbsolutePath(),
srcdir.getAbsolutePath());
fail("exception expected");
} catch (IOException expected) {
diff --git a/org.jacoco.cli/src/org/jacoco/cli/internal/commands/Instrument.java b/org.jacoco.cli/src/org/jacoco/cli/internal/commands/Instrument.java
index d0980572..5fefc9dc 100644
--- a/org.jacoco.cli/src/org/jacoco/cli/internal/commands/Instrument.java
+++ b/org.jacoco.cli/src/org/jacoco/cli/internal/commands/Instrument.java
@@ -33,8 +33,8 @@ import org.kohsuke.args4j.Option;
*/
public class Instrument extends Command {
- @Option(name = "-destdir", usage = "directory to write instrumented Java classes to", metaVar = "<dir>", required = true)
- File destdir;
+ @Option(name = "-dest", usage = "path to write instrumented Java classes to", metaVar = "<dir>", required = true)
+ File dest;
@Argument(usage = "list of folder or files to instrument recusively", metaVar = "<sourcefiles>")
List<File> source = new ArrayList<File>();
@@ -53,10 +53,10 @@ public class Instrument extends Command {
new OfflineInstrumentationAccessGenerator());
int total = 0;
for (final File s : source) {
- total += instrumentRecursive(s, destdir);
+ total += instrumentRecursive(s, dest);
}
out.printf("[INFO] %s classes instrumented to %s.%n",
- Integer.valueOf(total), destdir.getAbsolutePath());
+ Integer.valueOf(total), dest.getAbsolutePath());
return 0;
}