pub struct GlobalArgs {Show 20 fields
pub cwd: PathBuf,
pub manifest_path: String,
pub api_url: String,
pub api_token: Option<String>,
pub org: Option<String>,
pub proxy_url: String,
pub ecosystems: Option<Vec<String>>,
pub download_mode: String,
pub offline: bool,
pub global: bool,
pub global_prefix: Option<PathBuf>,
pub json: bool,
pub verbose: bool,
pub silent: bool,
pub dry_run: bool,
pub yes: bool,
pub lock_timeout: Option<u64>,
pub break_lock: bool,
pub debug: bool,
pub no_telemetry: bool,
}Expand description
Arguments inherited by every subcommand via #[command(flatten)].
Every global flag is parseable on every subcommand. Commands that
don’t use a given flag ignore it silently — e.g. list --global parses
fine and the global field is unused at runtime.
Fields§
§cwd: PathBufWorking directory.
manifest_path: StringPath to patch manifest file (resolved relative to –cwd).
api_url: StringSocket API URL (authenticated endpoint).
api_token: Option<String>Socket API token. Absence selects the public patch proxy.
org: Option<String>Organization slug. Auto-resolved when omitted and a token is set.
proxy_url: StringPublic proxy URL used when no API token is set.
ecosystems: Option<Vec<String>>Restrict to these ecosystems (comma-separated).
download_mode: StringWhich kind of patch artifact to download when local files are missing.
diff (default) fetches the smallest delta archive; package fetches
a full per-package tarball; file falls back to legacy per-file blobs.
offline: boolStrict airgap: never contact the network. Operations that need remote data fail loudly when this is set.
global: boolOperate on globally-installed packages.
global_prefix: Option<PathBuf>Override the path used to discover globally-installed packages.
json: boolEmit machine-readable JSON output.
verbose: boolShow extra detail in human-readable output.
silent: boolSuppress non-error output.
dry_run: boolPreview the operation without making any mutations.
yes: boolSkip interactive prompts.
lock_timeout: Option<u64>Seconds to wait for <.socket>/apply.lock before giving up.
Default (None) and 0 both mean a single non-blocking try
— failing immediately if another process holds the lock. A
positive value retries with a 100 ms backoff until the lock
frees or the budget elapses. Only meaningful for the mutating
subcommands (apply, rollback, repair, remove); other
commands accept it silently.
break_lock: boolForce-remove <.socket>/apply.lock before attempting
acquisition. Use when you are certain no other socket-patch
process is running (e.g. a previous run crashed in a way that
stripped the OS lock but left the file). Emits a
lock_broken warning event in the JSON envelope so the
action is auditable. Only meaningful for mutating
subcommands; other commands accept it silently.
debug: boolEmit verbose debug logs to stderr.
no_telemetry: boolDisable anonymous usage telemetry.
Implementations§
Source§impl GlobalArgs
impl GlobalArgs
Sourcepub fn resolved_manifest_path(&self) -> PathBuf
pub fn resolved_manifest_path(&self) -> PathBuf
Resolve manifest_path against cwd. See
socket_patch_core::manifest::operations::resolve_manifest_path.
Sourcepub fn api_client_overrides(&self) -> ApiClientEnvOverrides
pub fn api_client_overrides(&self) -> ApiClientEnvOverrides
Build ApiClientEnvOverrides from the CLI flags.
api_token and org are forwarded as Some(_) only when set.
api_url and proxy_url are forwarded only when non-empty;
GlobalArgs::default() leaves both empty so integration tests
that mutate env vars after constructing args still get env-var
resolution from get_api_client_with_overrides. In production
clap always populates them with either the CLI value, the env
value, or the clap-declared default — all non-empty — so the
resolved value still flows through.
Trait Implementations§
Source§impl Args for GlobalArgs
impl Args for GlobalArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for GlobalArgs
impl Clone for GlobalArgs
Source§fn clone(&self) -> GlobalArgs
fn clone(&self) -> GlobalArgs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GlobalArgs
impl Debug for GlobalArgs
Source§impl Default for GlobalArgs
impl Default for GlobalArgs
Source§fn default() -> Self
fn default() -> Self
Defaults intended for test struct literals (e.g. ..GlobalArgs::default()).
In production every field is populated by clap (with the
default_value = ".." attribute providing the documented defaults
when neither CLI flag nor env var is set), so this Default is
only reached from tests building GlobalArgs directly.
api_url and proxy_url are intentionally empty here (not
the production default URLs). That lets tests set
SOCKET_API_URL / SOCKET_PROXY_URL via std::env::set_var
after constructing the args struct and have those env vars
flow through to the API client — api_client_overrides skips
empty values so the underlying get_api_client_with_overrides
falls back to env-var resolution.
Source§impl FromArgMatches for GlobalArgs
impl FromArgMatches for GlobalArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for GlobalArgs
impl RefUnwindSafe for GlobalArgs
impl Send for GlobalArgs
impl Sync for GlobalArgs
impl Unpin for GlobalArgs
impl UnsafeUnpin for GlobalArgs
impl UnwindSafe for GlobalArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more