public static void main(String[] args) {
        File xmlFile = getOrCreateXmlFile();

        commandLineParser = new GnuParser();

        Options options = OptionProcessor.buildOptions();

        try {
            CommandLine commandLine = commandLineParser.parse(options, args);

            if (commandLine.getOptions().length == 0 || commandLine.hasOption("h")) {
                HelpFormatter formatter = new HelpFormatter();
                formatter.printHelp("timetracker", options, true);
            } else {
                XmlDataSource xmlDataSource = new XmlDataSource(xmlFile);
                DefaultTimeTracker defaultTimeTracker = new DefaultTimeTracker(xmlDataSource);
                OptionProcessor optionsProcessor = new OptionProcessor(commandLine, defaultTimeTracker);
                optionsProcessor.process();
            }
        } catch (AlreadySelectedException e) {
            LOGGER.error("Choose only one from these options: s, e, l, u and r.");
        } catch (MissingArgumentException e) {
            LOGGER.error(e.getMessage());
        } catch (ParseException e) {
            LOGGER.error(e.getMessage());
        } catch (TimeTrackerException e) {
            LOGGER.error(e.getMessage());
        } catch (java.text.ParseException e) {
            LOGGER.error(e.getMessage());
        } catch (RuntimeException e) {
            LOGGER.error(e.getMessage());
        }
    }