def parse_common_args()

in common/utils/utils.py [0:0]


def parse_common_args(parser: ArgumentParser) -> Namespace:
    """
    Parses command-line arguments for the data transfer CLI tool.
    """
    parser.add_argument(
        "-d",
        "--dry-run",
        default=False,
        type=str2bool,
        help=(
            "Dry run mode: If True, the dataset name defaults to "
            "'transfer_tooling_dry_run' unless explicitly specified. If False, "
            "the dataset name defaults to 'transfer_tooling'. (default: False)"
        ),
    )
    parser.add_argument(
        "-p",
        "--project",
        type=str,
        help="The name of the project in which the service operates.",
    )
    parser.add_argument(
        "-dn",
        "--dataset-name",
        type=str,
        help=(
            "The name of the dataset to use for storing or processing data. "
            "If not specified, defaults to 'transfer_tooling' or "
            "'transfer_tooling_dry_run' based on the dry-run flag."
        ),
    )
    parser.add_argument(
        "-dl",
        "--dataset-location",
        default="US",
        type=str,
        help=(
            "The location/region where the dataset should be created. "
            "This is only required if the dataset does not already exist. "
            "(default: 'US' if not specified)."
        ),
    )

    args = parser.parse_args()

    if not args.project:
        parser.error(
            "The --project argument is required. Please specify a project."
        )