pub struct CommandLineArgs {Show 29 fields
pub help: Option<bool>,
pub version: Option<bool>,
pub disallow_overwriting_regular_files_via_output_redirection: bool,
pub command: Option<String>,
pub interactive: bool,
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 verbose: bool,
pub print_commands_and_arguments: bool,
pub disable_bracketed_paste: bool,
pub disable_color: bool,
pub enable_highlighting: bool,
pub input_backend: Option<InputBackend>,
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.
disallow_overwriting_regular_files_via_output_redirection: boolEnable noclobber shell option.
command: Option<String>Execute the provided command and then exit.
interactive: boolRun in interactive mode.
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.
exit_after_one_command: boolRun only one command.
verbose: boolPrint input when it’s processed.
print_commands_and_arguments: boolPrint commands as they execute.
disable_bracketed_paste: boolDisable bracketed paste.
disable_color: boolDisable colorized output.
enable_highlighting: boolEnable syntax highlighting (experimental).
input_backend: Option<InputBackend>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 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 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 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> 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