def METHOD_NAME(parser):
    """Parser setup common to both rez-build and rez-release."""
    from rez.build_process import get_build_process_types
    from rez.build_system import get_valid_build_systems
    from rez.exceptions import PackageMetadataError
    process_types = get_build_process_types()
    parser.add_argument(
        "--process", type=str, choices=process_types, default="local",
        help="the build process to use (default: %(default)s).")
    # add build system choices valid for this package
    try:
        package = get_current_developer_package()
    except PackageMetadataError:
        package = None  # no package, or bad package
    clss = get_valid_build_systems(os.getcwd(), package=package)
    if clss:
        if len(clss) == 1:
            cls_ = clss[0]
            title = "%s build system arguments" % cls_.name()
            group = parser.add_argument_group(title)
            cls_.bind_cli(parser, group)
        types = [x.name() for x in clss]
    else:
        types = None
    parser.add_argument(
        "-b", "--build-system", dest="buildsys", choices=types,
        help="the build system to use. If not specified, it is detected. Set "
        "'build_system' or 'build_command' to specify the build system in the "
        "package itself.")
    parser.add_argument(
        "--variants", nargs='+', type=int, metavar="INDEX",
        help="select variants to build (zero-indexed).")
    parser.add_argument(
        "--ba", "--build-args", dest="build_args", metavar="ARGS",
        help="arguments to pass to the build system. Alternatively, list these "
        "after a '--'.")
    parser.add_argument(
        "--cba", "--child-build-args", dest="child_build_args", metavar="ARGS",
        help="arguments to pass to the child build system, if any. "
        "Alternatively, list these after a second '--'.")