pub struct App { /* private fields */ }Expand description
Command-line application parser
Stack-allocated structure that defines the command-line interface schema. All fields use heap-allocated collections for dynamic argument counts, but the parser itself is deterministic and type-safe.
Implementations§
Source§impl App
impl App
pub fn new(name: impl Into<String>) -> Self
pub fn version(self, version: impl Into<String>) -> Self
pub fn about(self, about: impl Into<String>) -> Self
pub fn command(self, cmd: Command) -> Self
pub fn arg(self, arg: Arg) -> Self
pub fn group(self, group: ArgGroup) -> Self
pub fn colored_help(self, colored: bool) -> Self
Sourcepub fn config_file(self, path: impl Into<String>) -> Self
pub fn config_file(self, path: impl Into<String>) -> Self
Enable config file parsing (TOML-like format)
Sourcepub fn env_prefix(self, prefix: impl Into<String>) -> Self
pub fn env_prefix(self, prefix: impl Into<String>) -> Self
Set environment variable prefix for fallback Example: prefix “MYAPP” allows MYAPP_PORT=8080
Sourcepub fn generate_completion(&self, shell: Shell) -> String
pub fn generate_completion(&self, shell: Shell) -> String
Generate shell completion script
pub fn parse(self) -> Matches
Auto Trait Implementations§
impl Freeze for App
impl RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnwindSafe for App
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