# HG changeset patch
# User František Kučera <franta-hg@frantovo.cz>
# Date 1410974027 -7200
# Node ID 944a81a54bb93b2bcf8895efbf5fa9c3cd20acbe
# Parent  a72d55ff30c97250ccb8e87156c8323964146159
cli: parse reader features option

diff -r a72d55ff30c9 -r 944a81a54bb9 java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIOptions.java
--- a/java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIOptions.java	Sun Sep 07 01:28:07 2014 +0200
+++ b/java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIOptions.java	Wed Sep 17 19:13:47 2014 +0200
@@ -23,7 +23,9 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
@@ -45,6 +47,7 @@
 
 	private String systemId;
 	private final Properties readerProperties = new Properties();
+	private final Map<String, Boolean> readerFeatures = new HashMap<>();
 
 	private OutputStream outputStream;
 	private String action;
@@ -131,6 +134,14 @@
 		return readerProperties;
 	}
 
+	public void addReaderFeature(String name, boolean value) {
+		readerFeatures.put(name, value);
+	}
+
+	public Map<String, Boolean> getReaderFeatures() {
+		return readerFeatures;
+	}
+
 	public void addActionProperty(String name, String value) {
 		actionProperties.put(name, value);
 	}
diff -r a72d55ff30c9 -r 944a81a54bb9 java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIParser.java
--- a/java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIParser.java	Sun Sep 07 01:28:07 2014 +0200
+++ b/java/alt2xml-cli/src/cz/frantovo/alt2xml/cli/CLIParser.java	Wed Sep 17 19:13:47 2014 +0200
@@ -100,6 +100,16 @@
 						return index - originalIndex;
 					}
 				},
+		READER_FEATURE("--reader-feature") {
+					@Override
+					public int parse(String[] args, int index, CLIOptions options) throws CLIParserException {
+						int originalIndex = index;
+						String name = fetchNext(args, ++index);
+						String value = fetchNext(args, ++index);
+						options.addReaderFeature(name, Boolean.valueOf(value));
+						return index - originalIndex;
+					}
+				},
 		ACTION("--action") {
 					@Override
 					public int parse(String[] args, int index, CLIOptions options) throws CLIParserException {