def parse_args()

in antlir/rpm/allowed_versions/update_allowed_versions.py [0:0]


def parse_args(argv: List[str]):
    parser = argparse.ArgumentParser(
        description=__doc__,
        formatter_class=argparse.RawDescriptionHelpFormatter,
    )
    # XXX default all these to ./<whatevs>, use this as common pattern for
    #  - fb prod
    #  - fb test (--no-update-data-snapshot with real but fixed snapshots,
    #    probably)
    #  - oss test (without --no-update-data-snapshot)
    parser.add_argument(
        "--data-snapshot-dir",
        required=True,
        type=Path.from_argparse,
        help="Base directory for per-plugin snapshot directories.",
    )
    parser.add_argument(
        "--package-groups-dir",
        required=True,
        action="append",
        type=Path.from_argparse,
        help="Directories with package group definitions. It can be helpful for"
        " each flavor to combine multiple sets of package groups, one per RPM "
        "universe (https://facebookincubator.github.io/antlir/docs/concepts/"
        "rpms/overview/). For example, one dir might contain OS-release "
        "specific groups, and another might have OS-independent packages.",
    )
    parser.add_argument(
        "--version-sets-dir",
        required=True,
        type=Path.from_argparse,
        help="XXX read for list, write to update",
    )
    parser.add_argument(
        "--rpm-repo-snapshot",
        required=True,
        action="append",
        type=Path.from_argparse,
        help="Path to `rpm_repo_snapshot` build output. Can be repeated if "
        "your allowable version sets need to span multiple snapshots.",
    )
    parser.add_argument(
        "--flavor",
        required=True,
        type=str,
        help="The flavor for version selection.",
    )
    parser.add_argument(
        "--no-update-data-snapshot",
        action="store_false",
        dest="update_data_snapshot",
        help="XXX for faster iteration",
    )
    parser.add_argument("--debug", action="store_true", help="Log more?")
    return Path.parse_args(parser, argv)