Index: build.xml
===================================================================
--- build.xml	(revision 4450)
+++ build.xml	(working copy)
@@ -237,6 +237,15 @@
 		</javac>
 	</target>
 
+	<target name="options-file" depends="compile">
+		<mkdir dir="${build.classes}/help/en" />
+		<exec executable="java" dir="${build.classes}" failonerror="true" failifexecutionfails="true" input="doc/options.txt">
+			<arg value="buildoptions.OptionsBuilder" />
+			<arg value="../../resources/help/en/options" />
+		</exec>
+	</target>
+	
+
 	<!-- Build into the build direcotory.  All resource files are copied in. -->
 	<target name="build" depends="compile" description="Build everything into the build direcotory">
 		<copy todir="${build.classes}">
@@ -370,6 +379,7 @@
 				<attribute name="Implementation-Version" value="${project.version}" />
 			</manifest>
 			<include name="**/*.class"/>
+			<exclude name="**/buildoptions/**"/>
 			<include name="*.csv"/>
 			<include name="known-hgt.bin"/>
 			<include name="*.xml"/>
Index: doc/index.txt
===================================================================
--- doc/index.txt	(revision 4450)
+++ doc/index.txt	(working copy)
@@ -44,7 +44,7 @@
 This documents the language that is accepted by the TYP compiler that
 is included within mkgmap.
 
-[/doc/options '''Logging''']
+[/doc/logging '''Logging''']
 Instructions on how to control messages that are logged and to where
 they are written.
 
Index: doc/logging.txt
===================================================================
--- doc/logging.txt	(revision 4450)
+++ doc/logging.txt	(working copy)
@@ -43,5 +43,5 @@
 log file, with warning and error messages being also sent to stdout.
 
 Further information can be found at
-https://docs.oracle.com/javase/8/docs/technotes/guides/logging/overview.html
+[https://docs.oracle.com/javase/8/docs/technotes/guides/logging/overview.html https://docs.oracle.com/javase/8/docs/technotes/guides/logging/overview.html]
 
Index: doc/options.txt
===================================================================
--- doc/options.txt	(revision 4450)
+++ doc/options.txt	(working copy)
@@ -1,3 +1,5 @@
+=== Command line ===
+
 The command line is of the format:
 
 :	java.exe [java-options] -jar mkgmap.jar [mkgmap-options]
@@ -29,6 +31,7 @@
 disable specific logging messages. This is useful if you want to see
 certain types of message that are not logged by default or choose where
 the messages should be written.
+
 === Mkgmap options ===
 
 The order of the options is significant in that options only apply
@@ -49,7 +52,7 @@
 
 === File options ===
 
-filename
+;filename
 ;--input-file=filename
 : 	Read input data from the given file.  This option (or just a
 filename) may be specified more than once. Make sure you set all 
Index: resources/help/en/options
===================================================================
--- resources/help/en/options	(revision 4450)
+++ resources/help/en/options	(working copy)
@@ -1,3 +1,5 @@
+=== Command line ===
+
 The command line is of the format:
 
     java.exe [java-options] -jar mkgmap.jar [mkgmap-options]
@@ -26,8 +28,10 @@
     Specifies a logging configuration file that allows you to enable and
     disable specific logging messages. This is useful if you want to see
     certain types of message that are not logged by default or choose where the
-    messages should be written. === Mkgmap options ===
+    messages should be written.
 
+=== Mkgmap options ===
+
 The order of the options is significant in that options only apply to
 subsequent input files. If you are using splitter, you probably will need to
 put most of your options before '-c template.args' (this file is generated by
Index: src/buildoptions/OptionsBuilder.java
===================================================================
--- src/buildoptions/OptionsBuilder.java	(nonexistent)
+++ src/buildoptions/OptionsBuilder.java	(working copy)
@@ -0,0 +1,145 @@
+package buildoptions;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+public class OptionsBuilder {
+
+
+	public static void main(String[] args) {
+		final int indentSize = 4;
+		boolean hasNonAscii = false;
+		int lineNumber = 0;
+		File outputFile = new File(args[0]);
+		System.setProperty("line.separator", "\n");
+		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
+				BufferedWriter bw = new BufferedWriter(new FileWriter(outputFile))) {
+			String line;
+			String previousLine = "";
+			int indent = 0;
+			boolean preformatted = false;
+			while((line = br.readLine()) != null) {
+				++lineNumber;
+				if (!line.matches("\\p{ASCII}*")) {
+					System.err.println("Line " + lineNumber + " contains one or more non-ASCII characters.\r\n" + line);
+					hasNonAscii = true;
+				}
+				if (preformatted) {
+					if (line.trim().compareToIgnoreCase("</pre>") == 0)
+						preformatted = false;
+					else {
+					    bw.write(line);
+					    bw.newLine();
+					}
+				} else {
+					line = line.replaceAll("\\s+", " ");
+					if (line.length() > 0) {
+						if (line.startsWith(";")) {
+							line = line.substring(1);
+							indent = 0;
+							if (!previousLine.isEmpty()) {
+							    bw.write(previousLine);
+							    bw.newLine();
+							    previousLine = "";
+							}
+						}
+						else if (line.charAt(0) == ':') {
+							if (!previousLine.isEmpty()) {
+							    bw.write(previousLine);
+							    bw.newLine();
+							    previousLine = "";
+							}
+							indent = 1;
+							line = line.substring(1);
+							while (line.charAt(0) == ':') {
+								indent++;
+								line = line.substring(1);
+							}
+							if (line.charAt(0) == ';')
+								line = line.substring(1);
+						}
+						else if (line.trim().compareToIgnoreCase("<p>") == 0) {
+							if (!previousLine.isEmpty()) {
+							    bw.write(previousLine);
+							    bw.newLine();
+							    previousLine = "";
+							}
+							line = "";
+						    bw.newLine();
+						}
+						else if (line.trim().compareToIgnoreCase("<pre>") == 0) {
+							if (!previousLine.isEmpty()) {
+							    bw.write(previousLine);
+							    bw.newLine();
+							    previousLine = "";
+							}
+							line = "";
+						    preformatted = true;
+						}
+						line = line.trim();
+						if (!previousLine.isEmpty()) {
+							if (!line.isEmpty()) {
+								previousLine += " " + line;
+							}
+						} else {
+							previousLine = line;
+							for (int i = 0; i < indent; i++) {
+								for (int j = 0; j < indentSize; j++)
+									previousLine = " " + previousLine;
+							}
+						}
+						while (previousLine.length() > 79) {
+							line = previousLine.substring(0, 80);
+							int lastSpaceIndex = line.lastIndexOf(' ');
+							int firstNonSpaceIndex = 0;
+							while (firstNonSpaceIndex < 79) {
+								if (line.charAt(firstNonSpaceIndex) != ' ')
+									break;
+								firstNonSpaceIndex++;
+							}
+							if (lastSpaceIndex > firstNonSpaceIndex) {
+								line = line.substring(0, lastSpaceIndex);
+								previousLine = previousLine.substring(lastSpaceIndex + 1);
+								for (int i = 0; i < indent; i++) {
+									for (int j = 0; j < indentSize; j++)
+										previousLine = " " + previousLine;
+								}
+							    bw.write(line);
+							    bw.newLine();
+							}
+							else {
+							    bw.write(previousLine);
+							    bw.newLine();
+							    previousLine = "";
+							}
+						}
+					}
+					else {
+						indent = 0;
+						if (!previousLine.isEmpty()) {
+						    bw.write(previousLine);
+						    bw.newLine();
+						    previousLine = "";
+						}
+						bw.newLine();
+					}
+				}
+			}
+			if (!previousLine.isEmpty()) {
+			    bw.write(previousLine);
+			    bw.newLine();
+			}
+		} catch (IOException e) {
+			e.printStackTrace();
+			System.exit(-1);
+		}
+		if (hasNonAscii) {
+			System.exit(-1);
+		}
+	}
+
+}
