#! /usr/bin/env python

import sys
from optparse import OptionParser

from regurgitator.astview import ast2html


def main():
    usage = "usage: %prog MODULE"
    description = """
Super pretty-printer for python modules's AST(abstract syntax tree).
Prints generated HTML in stdout.
"""
    parser = OptionParser(usage=usage, description=description)
    (options, args) = parser.parse_args()
    if len(args) != 1:
        parser.error("incorrect number of arguments")
    ast2html.ast2html(args[0])

if __name__ == "__main__":
    main()
