pub struct CompletionOption {
pub complete_var: String,
}Expand description
Configuration for the shell completion option.
Fields§
§complete_var: StringThe environment variable that triggers completion.
Implementations§
Source§impl CompletionOption
impl CompletionOption
Sourcepub fn is_completion_requested(&self) -> bool
pub fn is_completion_requested(&self) -> bool
Check if completion is requested via environment variable.
Sourcepub fn get_completion_shell(&self) -> Option<String>
pub fn get_completion_shell(&self) -> Option<String>
Get the completion shell type if completion is requested.
Sourcepub fn is_source_request(&self) -> bool
pub fn is_source_request(&self) -> bool
Check if this is a “source” request (print the completion script).
Sourcepub fn handle_completion(&self, cmd: &dyn CommandLike, prog_name: &str) -> bool
pub fn handle_completion(&self, cmd: &dyn CommandLike, prog_name: &str) -> bool
Handle completion if requested.
Returns true if completion was handled and the program should exit.
Trait Implementations§
Source§impl Clone for CompletionOption
impl Clone for CompletionOption
Source§fn clone(&self) -> CompletionOption
fn clone(&self) -> CompletionOption
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CompletionOption
impl RefUnwindSafe for CompletionOption
impl Send for CompletionOption
impl Sync for CompletionOption
impl Unpin for CompletionOption
impl UnsafeUnpin for CompletionOption
impl UnwindSafe for CompletionOption
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