package comp3500.abn;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;

public class CommonsTest {

	
	public static final String HELP_TEXT = "Usage info...";
	
	private boolean helpMode = false;
	private boolean help_listEmitters = false;
	
	
	
	public void parse(String args[]) {
		Options options = new Options();
		
		options.addOption("help", "Display usage information");
		options.addOption("listEmitters", "List emitters available to format output with");
		
		CommandLineParser parser = new DefaultParser();
		
		CommandLine cmd = null;
		try {
			cmd = parser.parse(options, args);
		} catch (ParseException e) {
			System.err.println("Parse exception: " + e.getMessage());
		}
		
		if(cmd == null) {
			System.err.println("CLI parser failed to initialise");
			System.exit(-1);
		}
		
		if(cmd.hasOption("help")) {
			System.out.println(HELP_TEXT);
		}
		
	}
	
	public static void main(String args[]) {
		final String testArgs[] = {"-help"};
		
		CommonsTest commonsTest = new CommonsTest();
		commonsTest.parse(testArgs);
	}
}

@@ -145,32 +145,115 @@
 .DefaultParser;%0A
+import org.apache.commons.cli.Option;%0Aimport org.apache.commons.cli.OptionBuilder;%0A
 import org.apach
@@ -275,16 +275,16 @@
 ptions;%0A
-
 import o
@@ -597,16 +597,23 @@
 (%22help%22,
+ false,
  %22Displa
@@ -670,16 +670,23 @@
 itters%22,
+ false,
  %22List e
@@ -727,24 +727,240 @@
  with%22);%0A%09%09%0A
+%09%09options.addOption(%22i%22, %22input path%22);%0A%09%09options.addOption(%22input%22, %22input path%22);%0A%09%09%0A%09%09Option tempOption = OptionBuilder.withArgName(%22i%22).withArgName(%22input%22).hasArg().withDescription(%22input path%22).create();%0A%09%09%0A%09%09%0A
 %09%09CommandLin
@@ -1396,16 +1396,18 @@
 %5B%5D) %7B%0A%09%09
+//
 final St
@@ -1435,16 +1435,130 @@
 help%22%7D;%0A
+%09%09final String testArgs%5B%5D = %7B%22-i%22, %22inputRPSL%22, %22-o%22, %22outputPath%22, %22-e%22, %22odlConfig%22, %22-m%22, %22a=1%22, %22-m%22, %22b=2%22%7D;%0A
 %09%09%0A%09%09Com

Update CommonsTest.java to latest experimental version. Capturing before we delete it