pub struct BashArgParser {
pub prog_name: String,
pub options: Vec<BashCliOption>,
pub positionals: Vec<String>,
pub description: String,
}Expand description
A generated bash argument parser.
Fields§
§prog_name: StringProgram name for usage display.
options: Vec<BashCliOption>Options to parse.
positionals: Vec<String>Positional argument names.
description: StringUsage description.
Implementations§
Source§impl BashArgParser
impl BashArgParser
Sourcepub fn add_option(self, opt: BashCliOption) -> Self
pub fn add_option(self, opt: BashCliOption) -> Self
Add an option.
Sourcepub fn add_positional(self, name: &str) -> Self
pub fn add_positional(self, name: &str) -> Self
Add a positional argument name.
Sourcepub fn emit_usage(&self) -> String
pub fn emit_usage(&self) -> String
Emit the usage function.
Sourcepub fn emit_parse_block(&self) -> String
pub fn emit_parse_block(&self) -> String
Emit the full argument parsing block.
Trait Implementations§
Source§impl Clone for BashArgParser
impl Clone for BashArgParser
Source§fn clone(&self) -> BashArgParser
fn clone(&self) -> BashArgParser
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 BashArgParser
impl RefUnwindSafe for BashArgParser
impl Send for BashArgParser
impl Sync for BashArgParser
impl Unpin for BashArgParser
impl UnsafeUnpin for BashArgParser
impl UnwindSafe for BashArgParser
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