def doccli(argv):
    filename = None
    try:
        optlist, longopts, args = getopt.getopt(argv[1:], "?hD")
    except getopt.GetoptError:
        print doccli.__doc__
        return
    for opt, optarg in optlist:
        if opt in ("-?", "-h"):
            print doccli.__doc__
            return
        elif opt == "-D":
            from pycopia import autodebug
    if args:
        filename = args[0]

    io = CLI.ConsoleIO()
    ui = CLI.UserInterface(io)
    cmd = TopLevel(ui)
    cmd._environ["filename"] = filename
    if filename:
        doc = XHTML.get_document(filename)
    else:
        doc = XHTML.new_document()
    cmd._setup(doc, "doc> ")
    parser = CLI.CommandParser(cmd, historyfile=os.path.expandvars("$HOME/.hist_doccli"))
    parser.interact()
doccli [-h?] [-D] [<filename>]
dataset/ETHPy150Open kdart/pycopia/WWW/pycopia/WWW/doccli.py/doccli