#!/usr/bin/env python

"""
Command line. See makefile2dot --help.
"""

import argparse
from makefile2dot import makefile2dot

DESC = "Create a dot graph of a Makefile."
PARSER = argparse.ArgumentParser(description=DESC)
PARSER.add_argument('--direction', '-d', dest='direction', default="BT",
                    help="direction to draw graph ('BT', 'TB', 'LR', or 'RL')")

PARSER.add_argument('--output', '-o', dest='output', default="",
                    help="output file name (default: stdout).")

PARSER.add_argument('--view', '-v', action='store_true',
                    help="view the graph (disables output to stdout)")

ARGS = PARSER.parse_args()

makefile2dot(direction=ARGS.direction, output=ARGS.output, view=ARGS.view)
