Nibble's entry point.

    :param args: Command-line arguments, with the program in position 0.

def main(args):
    """
    Nibble's entry point.

    :param args: Command-line arguments, with the program in position 0.
    """

    args = _parse_args(args)

    # sort out logging output and level
    level = util.log_level_from_vebosity(args.verbosity)
    root = logging.getLogger()
    root.setLevel(level)
    handler = logging.StreamHandler(sys.stdout)
    handler.setLevel(level)
    handler.setFormatter(logging.Formatter('%(levelname)s %(message)s'))
    root.addHandler(handler)

    logger.debug(args)

    expression = ' '.join(args.expression)
    try:
        print(Parser().parse(expression))
    except (LexingError, ParsingError) as e:
        util.print_error(e)
        return 1

    return 0