Example of Usage for Version 1.x.x

public class Test {

	public static void main(String[] args) {
		try {
			if (Debug.ENABLED)
				for (String s : args)
					Debug.print(null, "Arguments are: " + s);

			// get new CommandLineParser
			CmdLineParser parser = new CmdLineParserImpl();
			
			// Use OptionBuilder class to build new Options
			OptionBuilder.buildNewOption("funf", 'f');
			//OptionBuilder.setRequired();
			OptionBuilder.setDescription("BLALAAAAÖSLJDLKSAJDLK lkasjdlas jaslkdj slasdj lakdsjasd   ajkdlasd  adksldajda lasjdsaldkj lasdk alsjdaldj ");
			IntegerOption funfOption = OptionBuilder.getNewIntegerOption();
			OptionBuilder.buildNewOption("hans", 'h');
			StringOption hansOption = OptionBuilder.getNewStringOption();
			OptionBuilder.buildNewOption("affe", 'a');
			BooleanOption affeOption = OptionBuilder.getNewBooleanOption();
			OptionBuilder.buildNewOption("vud", 'v');
			VoidOption vudOption = OptionBuilder.getNewVoidOption();
			OptionBuilder.buildNewOption("top", 't');
			VoidOption topOption = OptionBuilder.getNewVoidOption();		

			// Register created options to parser
			parser.registerOption(funfOption);
			parser.registerOption(hansOption);
			parser.registerOption(affeOption);
			parser.registerOption(vudOption);
			parser.registerOption(topOption);
			
			//parser.removeAllStrategies();
			//parser.addStrategy(new MultipleValueStrategy());
			//parser.addStrategy(new SimpleStrategy());
			//parser.addStrategy(new MultipleShortOptionStrategy());
			
			// Parser returns not recognized command line arguments after parsing
			String[] unknown = parser.parse(args);

			/* "getValues()" will return a list of values for an option.
			 * use "getValues().get(0)" if you expect the option to have only one value.
			 * "getValues()" needs a ".class" object when calling to properly cast
			 * result.
			 */
			List<String> hansValue = parser.getValues('h', String.class);
			boolean hansSet = parser.isSet('h');
			List<String> funfValue = parser.getValues('f', String.class);
			boolean funfSet = parser.isSet('f');
			List<Boolean> affeValue = parser.getValues('a', Boolean.class);
			boolean affeSet = parser.isSet('a');
			List<Void> vudValue = parser.getValues('v', Void.class);
			boolean vudSet = parser.isSet('v');
			List<Void> topValue = parser.getValues('t', Void.class);
			boolean topSet = parser.isSet('t');

			System.out.println("Option " + funfOption + ": Value: " + funfValue
					+ ", Set: " + funfSet);
					
					
			System.out.println("Option " + hansOption + ": Value: " + hansValue
					+ ", Set: " + hansSet);
			
			System.out.println("Option " + affeOption + ": Value: " + affeValue
					+ ", Set: " + affeSet);

			System.out.println("Option " + vudOption + ": Value: " + vudValue
					+ ", Set: " + vudSet);
			
			System.out.println("Option " + topOption + ": Value: " + topValue
					+ ", Set: " + topSet);


			System.out.println("unknown command line arguments: " + Arrays.toString(unknown));
			
			System.exit(0);

		} catch (NoValueExeption e) {
			System.err.println(e.toString());
			System.exit(1);
		} catch (NumberFormatException e) {
			System.err.println(e.toString());
			System.exit(1);
		} catch (OptionNotSetException e) {
			System.err.println(e.toString());
			System.exit(1);
		} catch(Throwable t){
			System.err.print(t.toString());
			System.exit(2);
		}
	}
}