[−][src]Struct trivial_argument_parser::ArgumentList
Acumulates arguments into list which then can be fed to parse.
Examples
use trivial_argument_parser::*; let mut args_list = ArgumentList::new(); args_list.append_arg(Argument::new(Some('d'), None, ArgType::Flag).unwrap()); args_list.append_arg(Argument::new(Some('p'), None, ArgType::Value).unwrap()); args_list.append_arg(Argument::new(Some('l'), Some("an-list"), ArgType::ValueList).unwrap());
Fields
dangling_values: Vec<String>arguments: Vec<Argument>Implementations
impl ArgumentList[src]
pub fn new() -> ArgumentList[src]
Create ArgumentList with empty vector of arguments.
pub fn append_arg(&mut self, argument: Argument)[src]
Append argument to the end of the list.
pub fn append_dangling_value(&mut self, value: &str)[src]
Append dangling values (dangling values)
pub fn search_by_short_name(
&mut self,
name: char
) -> Result<&mut Argument, String>[src]
&mut self,
name: char
) -> Result<&mut Argument, String>
Search arguments by short name
pub fn search_by_long_name(
&mut self,
name: &str
) -> Result<&mut Argument, String>[src]
&mut self,
name: &str
) -> Result<&mut Argument, String>
Search arguments by long name
pub fn parse_args(&mut self, input: Vec<String>) -> Result<(), String>[src]
Function that does all the parsing. You need to feed user input.
Examples
use trivial_argument_parser::*; let mut args_list = ArgumentList::new(); args_list.append_arg(Argument::new(Some('d'), None, ArgType::Flag).unwrap()); args_list.append_arg(Argument::new(Some('p'), None, ArgType::Value).unwrap()); args_list.append_arg(Argument::new(Some('l'), Some("an-list"), ArgType::ValueList).unwrap()); args_list.parse_args(args_to_string_vector(std::env::args())).unwrap();
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ArgumentList
impl Send for ArgumentList
impl Sync for ArgumentList
impl Unpin for ArgumentList
impl UnwindSafe for ArgumentList
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,