mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Wrote a usage message for the CommandLineRunner.
git-svn-id: https://zxing.googlecode.com/svn/trunk@962 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
c07fad6410
commit
0fe2f0365f
|
@ -55,6 +55,10 @@ public final class CommandLineRunner {
|
|||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args == null || args.length == 0) {
|
||||
printUsage();
|
||||
return;
|
||||
}
|
||||
Hashtable<DecodeHintType, Object> hints = null;
|
||||
boolean dumpResults = false;
|
||||
boolean dumpBlackPoint = false;
|
||||
|
@ -66,8 +70,9 @@ public final class CommandLineRunner {
|
|||
dumpResults = true;
|
||||
} else if ("--dump_black_point".equals(arg)) {
|
||||
dumpBlackPoint = true;
|
||||
} else if (arg.startsWith("--")) {
|
||||
} else if (arg.startsWith("-")) {
|
||||
System.out.println("Unknown command line option " + arg);
|
||||
printUsage();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -78,6 +83,14 @@ public final class CommandLineRunner {
|
|||
}
|
||||
}
|
||||
|
||||
private static void printUsage() {
|
||||
System.out.println("Decode barcode images using the ZXing library\n");
|
||||
System.out.println("usage: CommandLineRunner { file | dir | url } [ options ]");
|
||||
System.out.println(" --try_harder: Use the TRY_HARDER hint, default is normal (mobile) mode");
|
||||
System.out.println(" --dump_results: Write the decoded contents to input.txt");
|
||||
System.out.println(" --dump_black_point: Compare black point algorithms as input.mono.png");
|
||||
}
|
||||
|
||||
private static void decodeOneArgument(String argument, Hashtable<DecodeHintType, Object> hints,
|
||||
boolean dumpResults, boolean dumpBlackPoint) throws IOException,
|
||||
URISyntaxException {
|
||||
|
|
Loading…
Reference in a new issue