def METHOD_NAME(args):
    if args.do_download and args.do_upload:
        raise RuntimeError("Multiple actions defined")
    pids = set()
    if args.do_download:
        do_download(pids, args.path, args.url, args.headers)
    elif args.do_upload:
        do_upload(pids, args.path, args.url, args.headers)
    else:
        raise RuntimeError("No action defined")
    all_success = True
    while len(pids):
        pid, status = os.wait()
        pids.remove(pid)
        if status != 0:
            all_success = False
    sys.exit(0 if all_success else 1)