public Arguments parse(String[] args) {

        JCommander jCommander = new JCommander(this);
        jCommander.setProgramName("jsonschema2pojo");

        try {
            jCommander.parse(args);

            if (this.showHelp) {
                jCommander.usage();
                exit(EXIT_OKAY);
            } else if (printVersion) {
                Properties properties = new Properties();
                properties.load(getClass().getResourceAsStream("version.properties"));
                jCommander.getConsole().println(jCommander.getProgramName() + " version " + properties.getProperty("version"));
                exit(EXIT_OKAY);
            }
        } catch (IOException | ParameterException e) {
            System.err.println(e.getMessage());
            jCommander.usage();
            exit(EXIT_ERROR);
        }

        return this;
    }
@Test
    public void requestingVersionCausesVersion() {
        ArgsForTest args = (ArgsForTest) new ArgsForTest().parse(new String[] { "--version" });

        assertThat(args.didExit(), is(true));
        assertThat(new String(systemOutCapture.toByteArray(), StandardCharsets.UTF_8).matches("(?s)jsonschema2pojo version \\d.*"), is(true));
    }