#!/usr/bin/env python
import logging
import sys

import zymbit.commands
from zymbit.logconfig import config_logging


if __name__ == '__main__':
    config_logging()

    try:
        result = zymbit.commands.Command.process_command(zymbit.commands)
    except KeyboardInterrupt:
        pass
    except Exception, exc:
        logger = logging.getLogger()
        logger.exception(exc)

        sys.exit(1)
    else:
        sys.exit(result)
