# HG changeset patch
# User František Kučera <franta-hg@frantovo.cz>
# Date 1409840929 -7200
# Node ID 96ce967c018210eb12dd006dec5d12d57913c1a1
# Parent  9837e58e0754983e3195666f7cb3667b57e2c91c
cli: support --input-url and multiple names per option (might be used for short variants like -i, -a etc.)

diff -r 9837e58e0754 -r 96ce967c0182 java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIParser.java
--- a/java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIParser.java	Thu Sep 04 16:18:59 2014 +0200
+++ b/java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIParser.java	Thu Sep 04 16:28:49 2014 +0200
@@ -18,6 +18,8 @@
 package cz.frantovo.alt2xml.cli;
 
 import java.io.File;
+import java.util.Arrays;
+import java.util.Collection;
 
 /**
  * Converts command line arguments from String array to object.
@@ -80,7 +82,7 @@
 						return 0;
 					}
 				},
-		SYSTEM_ID("--system-id") {
+		SYSTEM_ID("--system-id", "--input-url") {
 					@Override
 					public int parse(String[] args, int index, CLIOptions options) throws CLIParserException {
 						int originalIndex = index;
@@ -127,10 +129,10 @@
 					}
 				};
 
-		private final String option;
+		private final Collection<String> options;
 
-		private Token(String option) {
-			this.option = option;
+		private Token(String... options) {
+			this.options = Arrays.asList(options);
 		}
 
 		/**
@@ -138,7 +140,7 @@
 		 * @return whether option is this token
 		 */
 		public boolean matches(String option) {
-			return this.option.equals(option);
+			return options.contains(option);
 		}
 
 		/**