pub struct Arguments(pub Vec<String>);Expand description
Struct that contains the arguments provided by the user
Tuple Fields§
§0: Vec<String>Implementations§
Source§impl Arguments
impl Arguments
Sourcepub fn new() -> Arguments
pub fn new() -> Arguments
Returns an Arguments struct that contains the arguments provided by the user with zigarg’s functionalities
Sourcepub fn has_args(&self) -> bool
pub fn has_args(&self) -> bool
Returns true if the user provided arguments other than the program name
Sourcepub fn eq(&self, num: usize) -> bool
pub fn eq(&self, num: usize) -> bool
Returns true if the number provided is equals to the number Arguments struct has
Sourcepub fn get(&self, index: usize) -> Option<&String>
pub fn get(&self, index: usize) -> Option<&String>
Returns a Some(&String) from the Arguments struct based on the provided index or None if not found
Sourcepub fn get_value(&self, query: &str) -> Option<&String>
pub fn get_value(&self, query: &str) -> Option<&String>
Returns value through Some('&String) of provided flag (not case sensitive) or None if not found
Sourcepub fn get_value_case_sensitive(&self, query: &str) -> Option<&String>
pub fn get_value_case_sensitive(&self, query: &str) -> Option<&String>
Returns value through Some(&String) of provided flag (case sensitive) or None if not found
Sourcepub fn get_index(&self, query: &str) -> Option<usize>
pub fn get_index(&self, query: &str) -> Option<usize>
Returns index through Some(usize) of the &str slice provided from the Arguments struct or None if not found (not case sensitive)
Sourcepub fn get_index_case_sensitive(&self, query: &str) -> Option<usize>
pub fn get_index_case_sensitive(&self, query: &str) -> Option<usize>
Returns index through Some(usize) of the &str slice provided from the Arguments struct or None if not found (case sensitive)
Sourcepub fn exist(&self, query: &str) -> bool
pub fn exist(&self, query: &str) -> bool
Returns true if provided &str slice is found on any of the arguments provided by the user in the Arguments struct (not case sensitive)
Sourcepub fn exist_case_sensitive(&self, query: &str) -> bool
pub fn exist_case_sensitive(&self, query: &str) -> bool
Returns true if provided &str slice is found on any of the arguments provided by the user in the Arguments struct (case sensitive)
Sourcepub fn get_after_index(&self, query: usize) -> Vec<String>
pub fn get_after_index(&self, query: usize) -> Vec<String>
Returns the rest of the arguments based on provided index