Commit c5317295 authored by Jan Reimes's avatar Jan Reimes
Browse files

feat(args): add environment variable support for workspace option

* Added envvar support for workspace name option in args.py
* Introduced TDC_WORKSPACE constant in env_vars.py for environment variable mapping
parent 3e6b619c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -258,7 +258,8 @@ DocxDirectOption = Annotated[
]
WorkspaceNameOption = Annotated[
    str | None,
    typer.Option("-w", "--workspace", help="Workspace name (default: active workspace)"),
    typer.Option("-w", "--workspace", help="Workspace name (default: active workspace)",
                envvar=ConfigEnvVar.TDC_WORKSPACE.name),
]
SourceKindOption = Annotated[
    str,
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ class ConfigEnvVar(StrEnum):
    TDC_FIGURES = "workspace.figures"
    TDC_TABLES = "workspace.tables"
    TDC_DEVICE = "workspace.device"
    TDC_WORKSPACE = "workspace.name"


TOML_PATH_TO_ENV_VAR: dict[str, str] = {e.value: e.name for e in ConfigEnvVar}