package edu.oregonstate.eecs.shp3d;

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

/**
 * Hello world!
 *
 */
public class App  {
	public static void main( String[] args ) {
		System.out.println( "Hello World!" );
		CommandLine commandLine = null;
		try {
			commandLine = parseOption(args);
		} catch (ParseException e) {
			e.printStackTrace();
			System.exit(1);
		}
		
		
		String shp3dOutputPath = commandLine.getOptionValue("shp3d");
	}

	private static CommandLine parseOption(String[] args) throws ParseException {
		Options option = new Options();
		option.addOption("shp3d", true, "fully-qualified path (with filename) for the output shp3d file");
		CommandLineParser parser = new BasicParser();

		return parser.parse(option, args);
	}
}

@@ -114,32 +114,77 @@
 mandLineParser;%0A
+import org.apache.commons.cli.HelpFormatter;%0A
 import org.apach
@@ -414,20 +414,16 @@
 n( %22
-Hello World!
+shp3d...
 %22 );
@@ -748,16 +748,17 @@
 s option
+s
  = new O
@@ -775,16 +775,68 @@
 %09%09option
+s.addOption(%22help%22, false, %22print usage%22);%0A%09%09options
 .addOpti
@@ -910,14 +910,119 @@
 put 
-shp3d 
+3D shapefile%22);%0A%09%09options.addOption(%22shp2d%22, true, %22fully-qualified path (with filename) for the input 2D shape
 file
@@ -1077,17 +1077,35 @@
 ();%0A
-%0A
 %09%09
-return
+CommandLine commandLine =
  par
@@ -1120,16 +1120,17 @@
 e(option
+s
 , args);
@@ -1130,13 +1130,195 @@
  args);%0A
+%09%09%0A%09%09if (commandLine.hasOption(%22help%22)) %7B%0A%09%09%09HelpFormatter formatter = new HelpFormatter();%0A%09%09%09formatter.printHelp( %22shp3d%22, options );%0A%09%09%09System.exit(0);%0A%09%09%7D%0A%0A%09%09return commandLine;%0A
 %09%7D%0A%7D%0A

add print usage