def parse_args()

in linux/cuda_installer/__main__.py [0:0]


def parse_args():
    parser = argparse.ArgumentParser(
        description="Manage GPU drivers and CUDA toolkit installation."
    )
    subparsers = parser.add_subparsers(
        dest="command", help="Install GPU driver or CUDA Toolkit."
    )

    # Subparser for install_driver
    install_driver_parser = subparsers.add_parser(
        "install_driver", help="Install GPU driver."
    )
    install_driver_parser.add_argument(
        "--secure-boot-pub-key",
        help="Path to the secure boot public key file.",
        required=False,
        type=pathlib.Path,
    )
    install_driver_parser.add_argument(
        "--secure-boot-priv-key",
        help="Path to the secure boot private key file.",
        required=False,
        type=pathlib.Path,
    )
    install_driver_parser.add_argument(
        "--ignore-no-gpu",
        action="store_true",
        help="Ignore the absence of a GPU.",
        required=False,
    )

    install_driver_parser.add_argument(
        "--installation-mode",
        help="Pick the installation mode. Either 'repo' or 'binary'. Repo mode will add NVIDIA repository to your sources list and install packages from repository. Binary will download binary installer files and use them to install. Default mode is 'repo'.",
        required=False,
        default="repo",
    )

    # Subparser for verify_driver
    verify_driver_parser = subparsers.add_parser(
        "verify_driver", help="Verify GPU driver installation."
    )

    # Subparser for uninstall_driver
    uninstall_driver_parser = subparsers.add_parser(
        "uninstall_driver", help="Uninstall GPU driver."
    )

    # Subparser for install_cuda
    install_cuda_parser = subparsers.add_parser(
        "install_cuda", help="Install CUDA Toolkit."
    )
    install_cuda_parser.add_argument(
        "--ignore-no-gpu",
        action="store_true",
        help="Ignore the absence of a GPU.",
        required=False,
    )
    install_cuda_parser.add_argument(
        "--installation-mode",
        help="Pick the installation mode. Either 'repo' or 'binary'. Repo mode will add NVIDIA repository to your sources list and install packages from repository. Binary will download binary installer files and use them to install. Default mode is 'repo'. You have to use the same mode you used when installing the driver.",
        required=False,
        default="repo",
    )

    # Subparser for verify_cuda
    verify_cuda_parser = subparsers.add_parser(
        "verify_cuda", help="Verify CUDA Toolkit installation."
    )

    return parser.parse_args()