@Test public void checkTargetMatchesWithRun() throws Exception { Cli c = new Cli(); File pom1 = temp.newFile(); c.run( new String[] { "-f", pom1.toString() } ); assertEquals( "Session file should match", pom1, ( (ManipulationSession) FieldUtils.readField( c, "session", true ) ).getPom() ); }
@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();  }