diff --git a/ctf/check.py b/ctf/check.py index 3176465..2a696e5 100644 --- a/ctf/check.py +++ b/ctf/check.py @@ -26,11 +26,17 @@ def check( bool, typer.Option( "--production", + envvar="CTF_PRODUCTION", help="Do a production deployment. Only use this if you know what you're doing.", ), ] = False, remote: Annotated[ - str, typer.Option("--remote", help="Incus remote to deploy to") + str, + typer.Option( + "--remote", + envvar="CTF_REMOTE", + help="Incus remote to deploy to", + ), ] = "local", ) -> None: ENV["INCUS_REMOTE"] = remote diff --git a/ctf/deploy.py b/ctf/deploy.py index 960fa18..cd7307d 100644 --- a/ctf/deploy.py +++ b/ctf/deploy.py @@ -40,19 +40,33 @@ def deploy( bool, typer.Option( "--production", + envvar="CTF_PRODUCTION", help="Do a production deployment. Only use this if you know what you're doing.", ), ] = False, remote: Annotated[ - str, typer.Option("--remote", help="Incus remote to deploy to") + str, + typer.Option( + "--remote", + envvar="CTF_REMOTE", + help="Incus remote to deploy to", + ), ] = "local", vm_remote: Annotated[ str | None, - typer.Option("--vm-remote", help="Incus remote for VM to be deployed to"), + typer.Option( + "--vm-remote", + envvar="CTF_VM_REMOTE", + help="Incus remote for VM to be deployed to", + ), ] = None, vm_project: Annotated[ str | None, - typer.Option("--vm-project", help="Incus project for VM to be deployed to"), + typer.Option( + "--vm-project", + envvar="CTF_VM_PROJECT", + help="Incus project for VM to be deployed to", + ), ] = None, redeploy: Annotated[ bool, typer.Option("--redeploy", help="Do not use. Use `ctf redeploy` instead.") diff --git a/ctf/destroy.py b/ctf/destroy.py index 4db4474..a423d55 100644 --- a/ctf/destroy.py +++ b/ctf/destroy.py @@ -35,11 +35,17 @@ def destroy( bool, typer.Option( "--production", + envvar="CTF_PRODUCTION", help="Do a production deployment. Only use this if you know what you're doing.", ), ] = False, remote: Annotated[ - str, typer.Option("--remote", help="Incus remote to deploy to") + str, + typer.Option( + "--remote", + envvar="CTF_REMOTE", + help="Incus remote to deploy to", + ), ] = "local", force: Annotated[ bool, diff --git a/ctf/generate.py b/ctf/generate.py index fb87680..3695de2 100644 --- a/ctf/generate.py +++ b/ctf/generate.py @@ -38,19 +38,33 @@ def generate( bool, typer.Option( "--production", + envvar="CTF_PRODUCTION", help="Do a production deployment. Only use this if you know what you're doing.", ), ] = False, remote: Annotated[ - str, typer.Option("--remote", help="Incus remote to deploy to") + str, + typer.Option( + "--remote", + envvar="CTF_REMOTE", + help="Incus remote to deploy to", + ), ] = "local", vm_remote: Annotated[ str | None, - typer.Option("--vm-remote", help="Incus remote for VM to be deployed to"), + typer.Option( + "--vm-remote", + envvar="CTF_VM_REMOTE", + help="Incus remote for VM to be deployed to", + ), ] = None, vm_project: Annotated[ str | None, - typer.Option("--vm-project", help="Incus project for VM to be deployed to"), + typer.Option( + "--vm-project", + envvar="CTF_VM_PROJECT", + help="Incus project for VM to be deployed to", + ), ] = None, redeploy: Annotated[ bool, typer.Option("--redeploy", help="Do not use. Use `ctf redeploy` instead.") diff --git a/ctf/redeploy.py b/ctf/redeploy.py index 1c3262a..7f1ace7 100644 --- a/ctf/redeploy.py +++ b/ctf/redeploy.py @@ -22,19 +22,33 @@ def redeploy( bool, typer.Option( "--production", + envvar="CTF_PRODUCTION", help="Do a production deployment. Only use this if you know what you're doing.", ), ] = False, remote: Annotated[ - str, typer.Option("--remote", help="Incus remote to deploy to") + str, + typer.Option( + "--remote", + envvar="CTF_REMOTE", + help="Incus remote to deploy to", + ), ] = "local", vm_remote: Annotated[ str | None, - typer.Option("--vm-remote", help="Incus remote for VM to be deployed to"), + typer.Option( + "--vm-remote", + envvar="CTF_VM_REMOTE", + help="Incus remote for VM to be deployed to", + ), ] = None, vm_project: Annotated[ str | None, - typer.Option("--vm-project", help="Incus project for VM to be deployed to"), + typer.Option( + "--vm-project", + envvar="CTF_VM_PROJECT", + help="Incus project for VM to be deployed to", + ), ] = None, force: Annotated[ bool, diff --git a/pyproject.toml b/pyproject.toml index 2a06fdc..93f7433 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "typer==0.24.1", "pydantic", ] -version = "4.6.0" +version = "4.6.1" classifiers = [ "Programming Language :: Python :: 3", "Operating System :: OS Independent",