diff -r f3b4caf1d05d -r 5019e3e93a4e java/copy-image-resizer/src/cz/frantovo/copyImageResizer/cli/CLIParser.java --- a/java/copy-image-resizer/src/cz/frantovo/copyImageResizer/cli/CLIParser.java Sun Nov 16 21:59:13 2014 +0100 +++ b/java/copy-image-resizer/src/cz/frantovo/copyImageResizer/cli/CLIParser.java Sun Nov 16 23:47:28 2014 +0100 @@ -17,6 +17,7 @@ */ package cz.frantovo.copyImageResizer.cli; +import cz.frantovo.copyImageResizer.RecursiveOptions; import java.io.File; import java.util.Arrays; import java.util.Collection; @@ -27,8 +28,8 @@ */ public class CLIParser { - public CLIOptions parseOptions(String[] args) throws CLIParserException { - CLIOptions options = new CLIOptions(); + public RecursiveOptions parseOptions(String[] args) throws CLIParserException { + RecursiveOptions options = new RecursiveOptions(); for (int i = 0; i < args.length; i++) { String arg = args[i]; @@ -63,7 +64,7 @@ INPUT_DIR("--input-dir") { // bash-completion: option @Override - public int parse(String[] args, int index, CLIOptions options) throws CLIParserException { + public int parse(String[] args, int index, RecursiveOptions options) throws CLIParserException { int originalIndex = index; String name = fetchNext(args, ++index); options.setInput(new File(name)); @@ -72,7 +73,7 @@ }, OUTPUT_DIR("--output-dir") { // bash-completion: option @Override - public int parse(String[] args, int index, CLIOptions options) throws CLIParserException { + public int parse(String[] args, int index, RecursiveOptions options) throws CLIParserException { int originalIndex = index; String name = fetchNext(args, ++index); options.setOutput(new File(name)); @@ -81,23 +82,23 @@ }, SIZE("--size") { // bash-completion: option @Override - public int parse(String[] args, int index, CLIOptions options) throws CLIParserException { + public int parse(String[] args, int index, RecursiveOptions options) throws CLIParserException { int originalIndex = index; int width = parseInt(fetchNext(args, ++index)); int height = parseInt(fetchNext(args, ++index)); String directory = width + "x" + height; - options.addSize(new CLIOptions.SizeSpecification(width, height, directory)); + options.addSize(new RecursiveOptions.SizeSpecification(width, height, directory)); return index - originalIndex; } }, SIZE_NAMED("--size-named") { // bash-completion: option @Override - public int parse(String[] args, int index, CLIOptions options) throws CLIParserException { + public int parse(String[] args, int index, RecursiveOptions options) throws CLIParserException { int originalIndex = index; int width = parseInt(fetchNext(args, ++index)); int height = parseInt(fetchNext(args, ++index)); String directory = fetchNext(args, ++index); - options.addSize(new CLIOptions.SizeSpecification(width, height, directory)); + options.addSize(new RecursiveOptions.SizeSpecification(width, height, directory)); return index - originalIndex; } }; @@ -134,6 +135,6 @@ * return 0, otherwise return positive integer: number of eaten arguments. * @throws CLIParserException */ - public abstract int parse(String[] args, int index, CLIOptions options) throws CLIParserException; + public abstract int parse(String[] args, int index, RecursiveOptions options) throws CLIParserException; } }