public IllegalStateException error(final String format, final Object... args) { final String message = String.format(format, args); if (error == DocoptLanguageError.class) { throw new DocoptLanguageError(message); } if (error == DocoptExitException.class) { throw new DocoptExitException(1, message, true); } return new IllegalStateException("Unexpected exception: " + error.getClass().getName()); } }
final PrintStream ps = (e.getExitCode() == 0) ? out : err; final String message = e.getMessage(); if (e.getPrintUsage()) { ps.println(usage); System.exit(e.getExitCode());
final PrintStream ps = (e.getExitCode() == 0) ? out : err; final String message = e.getMessage(); if (e.getPrintUsage()) { ps.println(usage); System.exit(e.getExitCode());
public IllegalStateException error(final String format, final Object... args) { final String message = String.format(format, args); if (error == DocoptLanguageError.class) { throw new DocoptLanguageError(message); } if (error == DocoptExitException.class) { throw new DocoptExitException(1, message, true); } return new IllegalStateException("Unexpected exception: " + error.getClass().getName()); } }
throw new DocoptExitException(0, doc.replaceAll("^\\n+|\\n+$", ""), false); throw new DocoptExitException(0, version, false);
throw new DocoptExitException(0, doc.replaceAll("^\\n+|\\n+$", ""), false); throw new DocoptExitException(0, version, false);
throw new DocoptExitException(1, null, true);
throw new DocoptExitException(1, null, true);