summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Marie Henaff <jmhenaff@google.com>2015-04-30 09:33:14 +0200
committerJean-Marie Henaff <jmhenaff@google.com>2015-04-30 10:35:15 +0200
commit5fe989c0b1b38273147be3227a997d2d7048ced7 (patch)
tree345c033bd7c3f1686b26e4a04747b7125c0993cb
parent3325ff45c8b2a6b8f6902ae16dbedd3a16e3be11 (diff)
downloadtoolchain_jill-5fe989c0b1b38273147be3227a997d2d7048ced7.zip
toolchain_jill-5fe989c0b1b38273147be3227a997d2d7048ced7.tar.gz
toolchain_jill-5fe989c0b1b38273147be3227a997d2d7048ced7.tar.bz2
Add mention of @<FILE> option in Jill's --help output
Bug: 18423843 Change-Id: I213ef56e71a54d6129a684a2e20af1d681ec1d45
-rw-r--r--jill/src/com/android/jill/Main.java18
-rw-r--r--jill/src/com/android/jill/Options.java5
2 files changed, 12 insertions, 11 deletions
diff --git a/jill/src/com/android/jill/Main.java b/jill/src/com/android/jill/Main.java
index 1843365..e35ba93 100644
--- a/jill/src/com/android/jill/Main.java
+++ b/jill/src/com/android/jill/Main.java
@@ -24,6 +24,7 @@ import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.ParserProperties;
import java.io.IOException;
+import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
@@ -41,7 +42,7 @@ public class Main {
options = getOptions(args);
if (options.askForHelp()) {
- printUsage(new CmdLineParser(options));
+ printUsage(System.out);
System.exit(ExitStatus.SUCCESS);
}
@@ -60,7 +61,7 @@ public class Main {
}
CmdLineParser parser = e.getParser();
if (parser != null) {
- printUsage(parser);
+ printUsage(System.out);
} else {
System.err.println("Try --help for help");
}
@@ -111,10 +112,13 @@ public class Main {
return options;
}
- private static void printUsage(@Nonnull CmdLineParser parser) {
- System.err.print("Main: ");
- parser.printSingleLineUsage(System.err);
- System.err.println();
- parser.printUsage(System.err);
+ protected static void printUsage(@Nonnull PrintStream printStream) {
+ CmdLineParser parser =
+ new CmdLineParser(new Options(), ParserProperties.defaults().withUsageWidth(100));
+ printStream.println("Usage: <options> <class files to be transformed contained recursively"
+ + " in directories or in a zip/jar file>");
+ printStream.println();
+ printStream.println("Options:");
+ parser.printUsage(printStream);
}
}
diff --git a/jill/src/com/android/jill/Options.java b/jill/src/com/android/jill/Options.java
index 2b0afac..8dad09b 100644
--- a/jill/src/com/android/jill/Options.java
+++ b/jill/src/com/android/jill/Options.java
@@ -34,10 +34,7 @@ import javax.annotation.Nonnull;
public class Options {
@CheckForNull
- @Argument(
- usage =
- "class files to be transformed contained recursively in directories or in a zip/jar file",
- metaVar = "FILE|DIRECTORY")
+ @Argument(usage = "read command line from file", metaVar = "@<FILE>")
private File binaryFile;
@Option(name = "--verbose", usage = "enable verbosity (default: false)")