Expand description
Legacy → new env-var compatibility shim.
The v3.0 CLI surface migrated three env vars from the SOCKET_PATCH_*
prefix to the unified SOCKET_* prefix:
| New | Legacy |
|---|---|
SOCKET_PROXY_URL | SOCKET_PATCH_PROXY_URL |
SOCKET_DEBUG | SOCKET_PATCH_DEBUG |
SOCKET_TELEMETRY_DISABLED | SOCKET_PATCH_TELEMETRY_DISABLED |
read_env_with_legacy reads the new name; if absent, it falls back to the
legacy name and prints a one-shot deprecation warning to stderr. The
warning fires unconditionally — even under --silent / --json — so
users see the transition signal in scripts and CI logs. The legacy names
will be removed in the next major release.
Constants§
- LEGACY_
ENV_ RENAMES - Renamed env vars whose legacy
SOCKET_PATCH_*names are still honored.
Functions§
- promote_
legacy_ env_ vars - Promote legacy
SOCKET_PATCH_*env vars to their newSOCKET_*names in-process. When the new name is unset and the legacy name is set, copy the value over and emit a one-shot deprecation warning to stderr. - read_
env_ with_ legacy - Read the new-style env var
new_name. If absent, fall back tolegacy_nameand print a one-shot deprecation warning to stderr (the warning fires regardless of CLI verbosity flags so users notice the transition). - warn_
legacy_ once - Print a one-shot deprecation warning. Public so callers that read the
legacy name through other code paths (e.g. clap’s
env =attribute, which reads only the new name) can still surface the deprecation when they detect the legacy name was set.