Example #1
0
def main(argv=None):
    directory = ''
    if argv is None:
        argv = sys.argv
    try:
        try:
            opts, args = getopt.getopt(argv[1:], "hd:v", ["help", "directory="])
        except getopt.error, msg:
            raise Usage(msg)
        
        # option processing
        for option, value in opts:
            if option == "-v":
                verbose = True
            if option in ("-h", "--help"):
                raise Usage(help_message)
            if option in ("-d", "--directory"):
                directory = value
    
        from attusage import AttUsage
        from report import Report, Directory
        usage = AttUsage()
        for filename in args:   
            usage.process(filename)
        directory = Directory(directory)
        report = Report(usage, directory=directory)
        for line in report.text():
          print line