Skip to main content

Module args

Module args 

Source
Expand description

Shared CLI arguments flattened into every subcommand.

GlobalArgs defines the flags that apply uniformly across every socket-patch subcommand. Each subcommand #[command(flatten)]s this struct into its own Args struct so the surface stays consistent.

Subcommands that don’t actually use a given global flag still accept it silently (no-op). See CLI_CONTRACT.md for the full contract.

Precedence for every flag: CLI arg > env var > default.

All env-var names use the SOCKET_* prefix. Three legacy SOCKET_PATCH_* names are still read at runtime (via socket_patch_core::env_compat) with a one-shot deprecation warning; they will be removed in the next major.

Structs§

GlobalArgs
Arguments inherited by every subcommand via #[command(flatten)].

Functions§

apply_env_toggles
Apply CLI-flag toggles for env-driven knobs by mirroring them into env vars. This is how --debug / --no-telemetry reach core code that reads SOCKET_DEBUG / SOCKET_TELEMETRY_DISABLED directly. Idempotent and a no-op when the flags are off.