pub struct CommandLineArgs {Show 38 fields
pub help: Option<bool>,
pub version: Option<bool>,
pub config_file: Option<PathBuf>,
pub no_config: bool,
pub disallow_overwriting_regular_files_via_output_redirection: bool,
pub command: Option<String>,
pub exit_on_nonzero_command_exit: bool,
pub disable_pathname_expansion: bool,
pub interactive: bool,
pub inherited_fds: Vec<i32>,
pub login: bool,
pub do_not_execute_commands: bool,
pub no_editing: bool,
pub no_profile: bool,
pub no_rc: bool,
pub do_not_inherit_env: bool,
pub enabled_options: Vec<String>,
pub disabled_options: Vec<String>,
pub enabled_shopt_options: Vec<String>,
pub disabled_shopt_options: Vec<String>,
pub posix: bool,
pub rc_file: Option<PathBuf>,
pub read_commands_from_stdin: bool,
pub sh_mode: bool,
pub exit_after_one_command: bool,
pub treat_unset_variables_as_error: bool,
pub verbose: bool,
pub print_commands_and_arguments: bool,
pub xtrace_file_path: Option<PathBuf>,
pub disable_bracketed_paste: bool,
pub disable_color: bool,
pub enable_highlighting: bool,
pub terminal_shell_integration: bool,
pub zsh_style_hooks: bool,
pub input_backend: Option<InputBackendType>,
pub enabled_debug_events: Vec<TraceEvent>,
pub disabled_events: Vec<TraceEvent>,
pub script_args: Vec<String>,
}Expand description
Parsed command-line arguments for the brush shell.
Fields§
§help: Option<bool>Display usage information.
version: Option<bool>Display shell version.
config_file: Option<PathBuf>Path to TOML-based brush config file (overrides default location).
no_config: boolDisable loading of TOML-based brush config file.
disallow_overwriting_regular_files_via_output_redirection: boolEnable noclobber shell option.
command: Option<String>Execute the provided command and then exit.
exit_on_nonzero_command_exit: boolEnable error-on-exit behavior.
disable_pathname_expansion: boolDisable pathname expansion (also known as filename globbing).
interactive: boolRun in interactive mode.
inherited_fds: Vec<i32>Inherit the specified file descriptors injected by the parent process.
login: boolMake shell act as if it had been invoked as a login shell.
do_not_execute_commands: boolDo not execute commands.
no_editing: boolDon’t use readline for input.
no_profile: boolDon’t process any profile/login files (/etc/profile, ~/.bash_profile, ~/.bash_login,
~/.profile).
no_rc: boolDon’t process “rc” files if the shell is interactive (e.g., ~/.bashrc, ~/.brushrc).
do_not_inherit_env: boolDon’t inherit environment variables from the calling process.
enabled_options: Vec<String>Enable option (set -o option).
disabled_options: Vec<String>Disable option (set -o option).
enabled_shopt_options: Vec<String>Enable shopt option.
disabled_shopt_options: Vec<String>Disable shopt option.
posix: boolDisable non-POSIX extensions.
rc_file: Option<PathBuf>Path to the rc file to load in interactive shells (instead of bash.bashrc and
~/.bashrc).
read_commands_from_stdin: boolRead commands from standard input.
sh_mode: boolRun in sh compatibility mode, as if run as /bin/sh.
exit_after_one_command: boolRun only one command and then exit.
treat_unset_variables_as_error: boolTreat expansion of an unset variable as an error.
verbose: boolPrint input when it’s processed.
print_commands_and_arguments: boolPrint commands as they execute.
xtrace_file_path: Option<PathBuf>Enable xtrace and configure for the given output file.
disable_bracketed_paste: boolDisable bracketed paste.
disable_color: boolDisable colorized output.
enable_highlighting: boolEnable syntax highlighting in input.
terminal_shell_integration: boolEnable terminal integration (experimental).
zsh_style_hooks: boolEnable zsh-style preexec/precmd hooks (experimental).
input_backend: Option<InputBackendType>Input backend.
enabled_debug_events: Vec<TraceEvent>Enable debug logging for classes of tracing events.
disabled_events: Vec<TraceEvent>Disable logging for classes of tracing events (takes same event types as --debug).
script_args: Vec<String>Path and arguments for script to execute (optional).
Implementations§
Source§impl CommandLineArgs
impl CommandLineArgs
Sourcepub fn default_values() -> Self
pub fn default_values() -> Self
Returns a CommandLineArgs with all clap-defined default values.
This is useful for detecting which CLI arguments were explicitly provided vs. which retained their default values (e.g., for config file merging).
Sourcepub fn is_interactive(&self) -> bool
pub fn is_interactive(&self) -> bool
Returns whether or not the arguments indicate that the shell should run in interactive mode.
Trait Implementations§
Source§impl Args for CommandLineArgs
impl Args for CommandLineArgs
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 CommandLineArgs
impl Clone for CommandLineArgs
Source§fn clone(&self) -> CommandLineArgs
fn clone(&self) -> CommandLineArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CommandFactory for CommandLineArgs
impl CommandFactory for CommandLineArgs
Source§impl FromArgMatches for CommandLineArgs
impl FromArgMatches for CommandLineArgs
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.Source§impl Parser for CommandLineArgs
impl Parser for CommandLineArgs
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for CommandLineArgs
impl RefUnwindSafe for CommandLineArgs
impl Send for CommandLineArgs
impl Sync for CommandLineArgs
impl Unpin for CommandLineArgs
impl UnsafeUnpin for CommandLineArgs
impl UnwindSafe for CommandLineArgs
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