def main():
    ' parse command line options and run commands.\n    '
    parser = argparse.ArgumentParser(description='A web crawler for testing website links validation.')
    parser.add_argument('-V', '--version', dest='version', action='store_true', help='show version')
    parser.add_argument('--log-level', default='INFO', help='Specify logging level, default is INFO.')
    parser.add_argument('--config-file', help='Specify config file path.')
    parser.add_argument('--seeds', default='http://debugtalk.com', help='Specify crawl seed url(s), several urls can be specified with pipe;               if auth needed, seeds can be specified like user1:pwd1@url1|user2:pwd2@url2')
    parser.add_argument('--include-hosts', help='Specify extra hosts to be crawled.')
    parser.add_argument('--cookies', help="Specify cookies, several cookies can be joined by '|'.             e.g. 'lang:en,country:us|lang:zh,country:cn'")
    parser.add_argument('--crawl-mode', default='BFS', help='Specify crawl mode, BFS or DFS.')
    parser.add_argument('--max-depth', default=5, type=int, help='Specify max crawl depth.')
    parser.add_argument('--concurrency', help='Specify concurrent workers number.')
    parser.add_argument('--save-results', default='NO', help='Specify if save results, default is NO.')
    parser.add_argument('--grey-user-agent', help='Specify grey environment header User-Agent.')
    parser.add_argument('--grey-traceid', help='Specify grey environment cookie traceid.')
    parser.add_argument('--grey-view-grey', help='Specify grey environment cookie view_gray.')
    try:
        from jenkins_mail_py import MailgunHelper
        mailer = MailgunHelper(parser)
    except ImportError:
        mailer = None
    args = parser.parse_args()
    if args.version:
        print('WebCrawler version: {}'.format(__version__))
        exit(0)
    log_level = getattr(logging, args.log_level.upper())
    logging.basicConfig(level=log_level)
    color_logging(('args: %s' % args))
    main_crawler(args, mailer)
parse command line options and run commands.
def main():
    ' \n    '
    parser = argparse.ArgumentParser(description='A web crawler for testing website links validation.')
    parser.add_argument('-V', '--version', dest='version', action='store_true', help='show version')
    parser.add_argument('--log-level', default='INFO', help='Specify logging level, default is INFO.')
    parser.add_argument('--config-file', help='Specify config file path.')
    parser.add_argument('--seeds', default='http://debugtalk.com', help='Specify crawl seed url(s), several urls can be specified with pipe;               if auth needed, seeds can be specified like user1:pwd1@url1|user2:pwd2@url2')
    parser.add_argument('--include-hosts', help='Specify extra hosts to be crawled.')
    parser.add_argument('--cookies', help="Specify cookies, several cookies can be joined by '|'.             e.g. 'lang:en,country:us|lang:zh,country:cn'")
    parser.add_argument('--crawl-mode', default='BFS', help='Specify crawl mode, BFS or DFS.')
    parser.add_argument('--max-depth', default=5, type=int, help='Specify max crawl depth.')
    parser.add_argument('--concurrency', help='Specify concurrent workers number.')
    parser.add_argument('--save-results', default='NO', help='Specify if save results, default is NO.')
    parser.add_argument('--grey-user-agent', help='Specify grey environment header User-Agent.')
    parser.add_argument('--grey-traceid', help='Specify grey environment cookie traceid.')
    parser.add_argument('--grey-view-grey', help='Specify grey environment cookie view_gray.')
    try:
        from jenkins_mail_py import MailgunHelper
        mailer = MailgunHelper(parser)
    except ImportError:
        mailer = None
    args = parser.parse_args()
    if args.version:
        print('WebCrawler version: {}'.format(__version__))
        exit(0)
    log_level = getattr(logging, args.log_level.upper())
    logging.basicConfig(level=log_level)
    color_logging(('args: %s' % args))
    main_crawler(args, mailer)