pub struct Shell {
pub shell: Option<String>,
pub dry_run: bool,
pub sync: bool,
pub print: bool,
pub fence: String,
pub info: String,
pub prompt: String,
pub fence_color: ColorSpec,
pub info_color: ColorSpec,
pub prompt_color: ColorSpec,
pub command_color: ColorSpec,
pub error_color: ColorSpec,
}
Expand description
Command runner
Please see also the module-level documentation for a high-level description and examples.
use sprint::*;
// Use the default configuration:
let shell = Shell::default();
// Or a custom configuration:
let shell = Shell {
shell: Some(String::from("sh -c")),
//shell: Some(String::from("bash -c")), // Use bash
//shell: Some(String::from("bash -xeo pipefail -c")), // Use bash w/ options
//shell: None, // Run directly instead of a shell
dry_run: false,
sync: true,
print: true,
fence: String::from("```"),
info: String::from("text"),
prompt: String::from("$ "),
fence_color: bunt::style!("#555555"),
info_color: bunt::style!("#555555"),
prompt_color: bunt::style!("#555555"),
command_color: bunt::style!("#00ffff+bold"),
error_color: bunt::style!("#ff0000+bold+italic"),
};
// Or modify it on the fly:
let mut shell = Shell::default();
shell.shell = None;
shell.sync = false;
// ...
Fields§
§shell: Option<String>
§dry_run: bool
§sync: bool
§print: bool
§fence: String
§info: String
§prompt: String
§fence_color: ColorSpec
§info_color: ColorSpec
§prompt_color: ColorSpec
§command_color: ColorSpec
§error_color: ColorSpec
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Shell
impl Send for Shell
impl Sync for Shell
impl Unpin for Shell
impl UnwindSafe for Shell
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
Mutably borrows from an owned value. Read more