List of usage examples for org.apache.commons.cli MissingOptionException getCause
public synchronized Throwable getCause()
From source file:net.ninjacat.stubborn.Stubborn.java
public static void main(String[] argv) throws ClassNotFoundException, ParseException { Options options = createOptions();/*from w ww.j a va2 s . c o m*/ if (argv.length == 0) { printHelp(options); return; } Class.forName(Bootstrapper.class.getCanonicalName()); CommandLineParser parser = new GnuParser(); try { CommandLine commandLine = parser.parse(options, argv); if (commandLine.hasOption("h")) { printHelp(options); return; } Context context = new Context(commandLine); Transformer transformer = Bootstrapper.get(Transformer.class); transformer.transform(context); } catch (MissingOptionException ex) { System.out.println("Missing required parameter " + ex.getMissingOptions()); printHelp(options); } catch (TransformationException ex) { System.out.println("Failed to perform transformation caused by " + ex.getCause()); System.out.println(ex.getMessage()); } }