pub struct CliContext {
pub non_interactive: bool,
}Expand description
CLI execution context
Tracks global CLI state such as non-interactive mode
Fields§
§non_interactive: boolWhether to run in non-interactive mode (no prompts)
Implementations§
Source§impl CliContext
impl CliContext
Sourcepub fn new(explicit_non_interactive: bool) -> Self
pub fn new(explicit_non_interactive: bool) -> Self
Create a new CLI context with auto-detection of TTY
§Arguments
explicit_non_interactive- Explicit –non-interactive flag from CLI
§Behavior
- If
explicit_non_interactiveis true, force non-interactive mode - Otherwise, auto-detect based on stdin TTY status
- When stdin is not a TTY, automatically enable non-interactive mode
Sourcepub fn is_non_interactive(&self) -> bool
pub fn is_non_interactive(&self) -> bool
Check if running in non-interactive mode
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