@Test public void checkVersionAndExit() { new Cli().run( new String[] { "--version" } ); assertTrue( systemOutRule.getLog().contains( "PME CLI" ) ); }
@SuppressWarnings("WeakerAccess") public int run( String[] args ) { CommandLine cl = new CommandLine(this); cl.setUsageHelpAutoWidth(true); cl.setExecutionStrategy(new CommandLine.RunAll()); cl.setOverwrittenOptionsAllowed(true); return cl.execute(args); }
Cli implements Callable<Integer> { @SuppressWarnings("WeakerAccess") public int run( String[] args ) { CommandLine cl = new CommandLine(this); cl.setUsageHelpAutoWidth(true); cl.setExecutionStrategy(new CommandLine.RunAll()); cl.setOverwrittenOptionsAllowed(true); return cl.execute(args); } }
Cli implements Callable<Integer> { @SuppressWarnings("WeakerAccess") public int run( String[] args ) { CommandLine cl = new CommandLine(this); cl.setUsageHelpAutoWidth(true); cl.setExecutionStrategy(new CommandLine.RunAll()); cl.setOverwrittenOptionsAllowed(true); return cl.execute(args); }  }
Cli implements Callable<Integer> { @SuppressWarnings("WeakerAccess") public int run( String[] args ) { CommandLine cl = new CommandLine(this); cl.setUsageHelpAutoWidth(true); cl.setExecutionStrategy(new CommandLine.RunAll()); cl.setOverwrittenOptionsAllowed(true); return cl.execute(args); }  static void main( String[] args ); @SuppressWarnings("WeakerAccess") // Public API. int run( String[] args ); @Override Integer call(); }
Cli implements Callable<Integer> { @SuppressWarnings("WeakerAccess") public int run( String[] args ) { CommandLine cl = new CommandLine(this); cl.setUsageHelpAutoWidth(true); cl.setExecutionStrategy(new CommandLine.RunAll()); cl.setOverwrittenOptionsAllowed(true); return cl.execute(args); }  static void main( String[] args ); @SuppressWarnings("WeakerAccess") // Public API. int run( String[] args ); @Override Integer call();  }