pub struct CliContext {
pub formatter: OutputFormatter,
pub verbose: bool,
pub debug: bool,
}Expand description
Context for command execution - holds formatter and logging options
Fields§
§formatter: OutputFormatterOutput formatter (JSON/text/quiet mode)
verbose: boolEnable verbose logging
debug: boolEnable debug logging
Implementations§
Source§impl CliContext
impl CliContext
Sourcepub fn new(
json_mode: bool,
quiet_mode: bool,
verbose: bool,
debug: bool,
) -> Self
pub fn new( json_mode: bool, quiet_mode: bool, verbose: bool, debug: bool, ) -> Self
Create a new CLI context
Sourcepub fn print_result(&self, result: &CommandResult) -> i32
pub fn print_result(&self, result: &CommandResult) -> i32
Print a result and return the exit code
Trait Implementations§
Source§impl Clone for CliContext
impl Clone for CliContext
Source§fn clone(&self) -> CliContext
fn clone(&self) -> CliContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CliContext
impl RefUnwindSafe for CliContext
impl Send for CliContext
impl Sync for CliContext
impl Unpin for CliContext
impl UnwindSafe for CliContext
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