def parse_args()

in src/blobfuse-launcher/blobfuse-launcher.py [0:0]


def parse_args():
    parser = argparse.ArgumentParser(
        prog="blobfuse-launcher.py",
        description="Launch blobfuse with secure key release",
    )
    parser.add_argument(
        "--skr-port", type=int, default=8284, help="The port for the SKR sidecar"
    )
    parser.add_argument(
        "--secrets-port",
        type=int,
        default=9300,
        help="The port for the secrets sidecar",
    )
    parser.add_argument(
        "--maa-endpoint",
        type=str,
        default=os.environ.get("MAA_ENDPOINT"),
        help="The MAA endpoint to use for secure key release",
    )
    parser.add_argument(
        "--akv-endpoint",
        type=str,
        default=os.environ.get("AKV_ENDPOINT"),
        help="The Azure Key Vault to use for secure key release",
    )
    parser.add_argument(
        "--kid", type=str, default=os.environ.get("KID"), help="The key ID in AKV"
    )
    parser.add_argument(
        "--imds-port", type=int, default=8290, help="The port for the Identity sidecar"
    )
    parser.add_argument(
        "--otel-collector-port",
        type=int,
        default=4317,
        help="The port for the OTel collector",
    )
    parser.add_argument(
        "--tenant-id",
        type=str,
        default=os.environ.get("TENANT_ID"),
        help="The tenant ID for the MSI token",
    )
    parser.add_argument(
        "--client-id",
        type=str,
        default=os.environ.get("CLIENT_ID"),
        help="The client ID for the MSI token",
    )
    parser.add_argument(
        "--mount-path",
        type=str,
        default="/mnt/blob",
        help="The mount path for blobfuse",
    )
    parser.add_argument(
        "--read-only",
        type=bool,
        action=argparse.BooleanOptionalAction,
        help="The mount container in read only or not",
    )
    parser.add_argument(
        "--use-adls",
        type=bool,
        action=argparse.BooleanOptionalAction,
        help="Use ADLS as the storage backend",
    )
    parser.add_argument(
        "--wrapped-dek-secret",
        type=str,
        default=os.environ.get("WRAPPED_DEK_SECRET"),
        help="The wrapped DEK secret",
    )
    parser.add_argument(
        "--wrapped-dek-akv-endpoint",
        type=str,
        default=os.environ.get("WRAPPED_DEK_AKV_ENDPOINT"),
        help="The Azure Key Vault endpoint holding the wrapped DEK",
    )
    parser.add_argument(
        "--sub-directory",
        type=str,
        default="",
        help="The sub-directory to mount the container for onelake storage",
    )
    parser.add_argument(
        "--custom-encryption-mode",
        type=str,
        choices=["CPK", "CSE", "None"],
        default="CPK",
        help="The encryption mode to use for blobfuse",
    )

    return parser.parse_args()