"""Select an explicit V1 size and ONE scope: render OR project. Plan by default."""
import argparse
from resolve_api_connection import connect
from resolve_api_output import cli_target, cli_write, print_result, run_action


def main():
    p = argparse.ArgumentParser(description=__doc__)
    cli_target(p)
    cli_write(p)
    p.add_argument("--scope", choices=("render", "project"), required=True)
    p.add_argument("--width", type=int, required=True)
    p.add_argument("--height", type=int, required=True)
    p.add_argument("--accept-mixed", action="store_true", help="Confirm an explicit size for mixed V1 sources")
    a = p.parse_args()
    return print_result(lambda: run_action(
        connect(), a.project_id, a.timeline_id, "resolution", scope=a.scope,
        width=a.width, height=a.height, accept_mixed=a.accept_mixed,
        apply=a.apply, expect_plan=a.expect_plan, test_copy=a.test_copy))


if __name__ == "__main__":
    raise SystemExit(main())
