FileDocCategorySizeDatePackage
mainopts.javaAPI DocExample797Sun Feb 08 21:34:06 GMT 2004None

mainopts

public class mainopts extends Object
Template main program using GetOpt.
author
Ian F. Darwin, http://www.darwinsys.com/
version
$Id: mainopts.java,v 1.5 2004/02/09 03:34:05 ian Exp $

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		String argChars = "o:hv";
		GetOpt go = new GetOpt("ho:v");
		boolean verbose = false;

		char c;
		while ((c = go.getopt(argv)) != 0) {
			switch(c) {
				case 'h":
					System.out.println("HELP!!");
					break;
				case 'o":
					System.out.print("-o Option " + go.optarg());
					break;
				case 'v":
					verbose = true;
					break;
				default:
					System.err.println("Unknown option char " + ((char)c));
			}
		}
		for (int i = go.getOptInd(); i<argv.length; i++)
			System.out.println("Filename-like arg " + argv[i]);