class Main {

    public static void main(String... args) throws Exception {
        AbstractCommand command = Main.parseCommandLine(args);
        try {
            command.execute();
        } catch (Exception err) {
            if (command instanceof Command && ((Command) command).verbose) {
                err.printStackTrace();
            } else {
                System.err.println("An error occurred: " + err.getMessage());
            }
            System.exit(1);
        }
    }

}