pub struct App<'a> { /* private fields */ }Expand description
Help and completion over the whole command tree, static and runtime alike.
Implementations§
Source§impl<'a> App<'a>
impl<'a> App<'a>
Sourcepub fn spec(&self) -> &'a Spec
pub fn spec(&self) -> &'a Spec
The merged tree: the host’s commands with the catalogued ones grafted in.
Sourcepub fn help(self, path: &str, long: bool) -> Option<String>
pub fn help(self, path: &str, long: bool) -> Option<String>
Render help for a static or runtime command path. The empty path is the root.
long is the --help / -h distinction: the full page or the summary.
Sourcepub async fn completion_request(self, argv: &[OsString]) -> Option<String>
pub async fn completion_request(self, argv: &[OsString]) -> Option<String>
Answer a hidden __complete_word__ invocation, or return None for ordinary argv.
Two answerers, one line. Up to the catch-all the words are the host’s, and the host’s own
tables answer for them — the same engine, so registered completers, multicall
projections and a --candidates request all keep working, and the catalogued names are
added where a subcommand belongs. Past it the words are a plugin’s, and that plugin’s
spec answers alone. A name in neither is a program nobody here can describe, and the
answer is nothing.
Sourcepub async fn complete_request(
self,
request: &CompletionRequest,
) -> Completions<'static>
pub async fn complete_request( self, request: &CompletionRequest, ) -> Completions<'static>
The answer to a parsed request, before it is written the way a shell reads it.
For a caller holding a Split rather than a shell’s argv, build the request with
CompletionRequest::for_split.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for App<'a>
impl<'a> RefUnwindSafe for App<'a>
impl<'a> Send for App<'a>
impl<'a> Sync for App<'a>
impl<'a> Unpin for App<'a>
impl<'a> UnsafeUnpin for App<'a>
impl<'a> UnwindSafe for App<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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