pub struct CommandLine { /* private fields */ }Expand description
Represents a command-line app.
Implementations§
Source§impl CommandLine
impl CommandLine
Sourcepub fn with_context(context: Context) -> Self
pub fn with_context(context: Context) -> Self
Constructs a new CommandLine with the provided Context.
Sourcepub fn suggestions(&self) -> Option<&SuggestionSource>
pub fn suggestions(&self) -> Option<&SuggestionSource>
Returns the SuggestionProvider used by this command-line.
Sourcepub fn use_default_help(self) -> Self
pub fn use_default_help(self) -> Self
Sets the default Help.
Sourcepub fn use_default_suggestions(self) -> Self
pub fn use_default_suggestions(self) -> Self
Sets the default SuggestionProvider.
Sourcepub fn use_suggestions(self, suggestions: SuggestionSource) -> Self
pub fn use_suggestions(self, suggestions: SuggestionSource) -> Self
Sets the SuggestionSource of this command-line context.
Sourcepub fn use_help(self, help: HelpSource) -> Self
pub fn use_help(self, help: HelpSource) -> Self
Sets the HelpSource of this command-line context.
Sourcepub fn use_help_option(self, option: CommandOption) -> Self
pub fn use_help_option(self, option: CommandOption) -> Self
Sets the help option for this command-line context.
Sourcepub fn use_help_command(self, command: Command) -> Self
pub fn use_help_command(self, command: Command) -> Self
Sets the help command for this command-line context.
Sourcepub fn use_version_option(self, option: CommandOption) -> Self
pub fn use_version_option(self, option: CommandOption) -> Self
Sets the version option for this command-line context.
Sourcepub fn use_version_command(self, command: Command) -> Self
pub fn use_version_command(self, command: Command) -> Self
Sets the version command for this command-line context.
Sourcepub fn parse_args(&mut self) -> Result<ParseResult>
pub fn parse_args(&mut self) -> Result<ParseResult>
Parse the program arguments get the ParseResult
after handling any help, version or suggestion messages.
Sourcepub fn parse_from<S, I>(&mut self, args: I) -> Result<ParseResult>
pub fn parse_from<S, I>(&mut self, args: I) -> Result<ParseResult>
Parse given arguments get the ParseResult
after handling any help, version or suggestion messages.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommandLine
impl !RefUnwindSafe for CommandLine
impl !Send for CommandLine
impl !Sync for CommandLine
impl Unpin for CommandLine
impl !UnwindSafe for CommandLine
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