@@ -0,0 +1,1963 @@
+/* %0D%0A * Copyright (C) 2016 Hobrasoft s.r.o.%0D%0A *%0D%0A * This program is free software: you can redistribute it and/or modify%0D%0A * it under the terms of the GNU Affero General Public License as published by%0D%0A * the Free Software Foundation, either version 3 of the License, or%0D%0A * (at your option) any later version.%0D%0A *%0D%0A * This program is distributed in the hope that it will be useful,%0D%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0D%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0D%0A * GNU Affero General Public License for more details.%0D%0A *%0D%0A * You should have received a copy of the GNU Affero General Public License%0D%0A * along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0D%0A */%0D%0Apackage cz.hobrasoft.pdfmu;%0D%0A%0D%0Aimport java.util.Map;%0D%0Aimport net.sourceforge.argparse4j.inf.Argument;%0D%0Aimport net.sourceforge.argparse4j.inf.ArgumentAction;%0D%0Aimport net.sourceforge.argparse4j.inf.ArgumentParser;%0D%0A%0D%0A/**%0D%0A * Argument action to print a message and exit program. Inspired by%0D%0A * %7B@link net.sourceforge.argparse4j.impl.action.VersionArgumentAction%7D.%0D%0A *%0D%0A * @author Filip Bartek%0D%0A */%0D%0Apublic class PrintAndExitAction implements ArgumentAction %7B%0D%0A%0D%0A    private final String message;%0D%0A%0D%0A    public PrintAndExitAction(String message) %7B%0D%0A        this.message = message;%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * Prints the message to %7B@link System#out%7D and terminates the program with%0D%0A     * the exit code 0. All the parameters are ignored.%0D%0A     */%0D%0A    @Override%0D%0A    public void run(ArgumentParser parser, Argument arg,%0D%0A            Map%3CString, Object%3E attrs, String flag, Object value) %7B%0D%0A        System.out.print(message);%0D%0A        System.exit(0);%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    public void onAttach(Argument arg) %7B%0D%0A        // Do nothing%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * @return always false because this action does not consume and argument%0D%0A     */%0D%0A    @Override%0D%0A    public boolean consumeArgument() %7B%0D%0A        return false;%0D%0A    %7D%0D%0A%7D%0D%0A

Add class PrintAndExitAction