def _main():
    parser = argparse.ArgumentParser()
    parser.add_argument('config', help='JSON configuration file')
    parser.add_argument('--only-download', action='store_true', help='Only download GTFS file')
    parser.add_argument('--use-no-q-dirs', action='store_true', help='Do not use Q dirs')
    args = parser.parse_args()

    _init_logging()

    start_time = time.time()
    logging.debug('started {}'.format(sys.argv))

    config = _load_config(args.config)

    gtfs_name = config['name']
    downloaded_gtfs_zip = _download_gtfs(config['url'])
    modify_date = _get_modify_date(downloaded_gtfs_zip)
    gtfs_dir = _get_q_dir(config['gtfs_dir'], modify_date, not args.use_no_q_dirs)
    gtfs_zip = _rename_gtfs_zip(gtfs_dir, downloaded_gtfs_zip, gtfs_name, modify_date)
    if gtfs_zip and (not args.only_download):
        log_dir = _get_q_dir(config['log_dir'], modify_date, not args.use_no_q_dirs)
        _generate_json(gtfs_name, modify_date, gtfs_zip, config['json_dir'], log_dir)

    logging.debug('took {} seconds, max mem: {} megabytes'.format(
        int(time.time() - start_time), resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1024))