Skip to main content

Module env_compat

Module env_compat 

Source
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:

NewLegacy
SOCKET_PROXY_URLSOCKET_PATCH_PROXY_URL
SOCKET_DEBUGSOCKET_PATCH_DEBUG
SOCKET_TELEMETRY_DISABLEDSOCKET_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 new SOCKET_* 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 to legacy_name and 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.