void run() { Performable performable = null; final Optional<String> command = this.arguments.getCommand(); if (!command.isPresent()) { throw new IllegalStateException("Command missing trying to execute OFT mode."); } switch (command.get()) { case ConvertCommand.COMMAND_NAME: performable = new ConvertCommand(this.arguments); break; case TraceCommand.COMMAND_NAME: performable = new TraceCommand(this.arguments); break; default: throw new IllegalStateException( "Unknown command '" + command.get() + "' trying to execute OFT mode."); } if (performable.run()) { exit(ExitStatus.OK); } else { exit(ExitStatus.FAILURE); } }
void run() { Performable performable = null; final Optional<String> command = this.arguments.getCommand(); if (!command.isPresent()) { throw new IllegalStateException("Command missing trying to execute OFT mode."); } switch (command.get()) { case ConvertCommand.COMMAND_NAME: performable = new ConvertCommand(this.arguments); break; case TraceCommand.COMMAND_NAME: performable = new TraceCommand(this.arguments); break; default: throw new IllegalStateException( "Unknown command '" + command.get() + "' trying to execute OFT mode."); } if (performable.run()) { exit(ExitStatus.OK); } else { exit(ExitStatus.FAILURE); } }