pub struct WrapperSpec {
pub name: String,
pub short_value_flags: Vec<String>,
pub long_value_flags: Vec<String>,
pub unanalyzable_flags: Vec<String>,
pub skip_env_assignments: bool,
pub has_terminator: bool,
pub skip_positionals: usize,
}Expand description
Describes how to strip a transparent wrapper command to find the inner command.
Each wrapper has different flag semantics. This struct captures just enough
to correctly skip past the wrapper and its flags to the real command.
Designed for deserialization from config files — consumers load specs from
JSON/TOML/YAML and pass them to [resolve_command_with].
Fields§
§name: StringCommand name to match (basename, e.g., “sudo”).
short_value_flags: Vec<String>Short flags that consume the next token as a value (e.g., ["-u", "-g"]).
long_value_flags: Vec<String>Long flags that consume the next token as a value (e.g., ["--user", "--group"]).
unanalyzable_flags: Vec<String>Flags whose presence makes the entire invocation unanalyzable.
Example: env -S executes its value as a command string (eval-equivalent).
skip_env_assignments: boolWhether to skip leading KEY=VALUE tokens after the wrapper (env-style).
has_terminator: boolWhether -- terminates flag processing for this wrapper.
skip_positionals: usizeNumber of leading positional arguments to skip before the inner command.
Some wrappers require mandatory positional args before the command:
timeout DURATION cmd, chrt PRIORITY cmd, taskset MASK cmd.
Set this to the number of positionals to consume before treating
the next non-flag token as the inner command.
Trait Implementations§
Source§impl Clone for WrapperSpec
impl Clone for WrapperSpec
Source§fn clone(&self) -> WrapperSpec
fn clone(&self) -> WrapperSpec
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 WrapperSpec
impl Debug for WrapperSpec
Source§impl<'de> Deserialize<'de> for WrapperSpec
impl<'de> Deserialize<'de> for WrapperSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for WrapperSpec
impl PartialEq for WrapperSpec
Source§fn eq(&self, other: &WrapperSpec) -> bool
fn eq(&self, other: &WrapperSpec) -> bool
self and other values to be equal, and is used by ==.