pub struct Args {
pub template_names: Vec<String>,
pub server_url: String,
pub generator_uri: String,
pub lister_uri: String,
pub show_help: bool,
pub show_version: bool,
pub show_author: bool,
pub show_list: bool,
}Expand description
Struct to gather cli args parsing result.
Used by crate::parser::ArgsParser implementations to store
parsing result.
Fields§
§template_names: Vec<String>A non-empty list of gitignore template names.
- Represented by the provided positional arguments, and required
unless any of
author,versionorhelpoptions are given. - This field does not allow commas in any of its field.
server_url: StringThe gitignore template generator service url.
- Optional value represented by the cli option
crate::constant::cli_options::SERVER_URLthat takes a string value, and falling back tocrate::constant::template_manager::BASE_URLif not provided in cli args.
generator_uri: StringThe gitignore template generator service endpoint uri.
- Optional value represented by the cli option
crate::constant::cli_options::GENERATOR_URIthat takes a string value, and falling back tocrate::constant::template_manager::GENERATOR_URIif not provided in cli args.
lister_uri: StringThe gitignore template lister service endpoint uri.
- Optional value represented by the cli option
crate::constant::cli_options::LISTER_URIthat takes a string value, and falling back tocrate::constant::template_manager::LISTER_URIif not provided in cli args.
show_help: boolThe boolean indicator of whether to display help infos or not.
- Optional value represented by the cli option
crate::constant::cli_options::HELP, and falling back tofalseif not provided in cli args. - Has precedence over version and author options if multiple are given
show_version: boolThe boolean indicator of whether to display version infos or not.
- Optional value represented by the cli option
crate::constant::cli_options::VERSION, and falling back tofalseif not provided in cli args. - Has precedence over author option if multiple are given
The boolean indicator of whether to display author infos or not.
- Optional value represented by the cli option
crate::constant::cli_options::AUTHOR, and falling back tofalseif not provided in cli args.
show_list: boolThe boolean indicator of whether to display list of available templates or not.
- Optional value represented by the cli option
crate::constant::cli_options::LIST, and falling back tofalseif not provided in cli args.
Implementations§
Source§impl Args
impl Args
Sourcepub fn with_template_names(self, template_names: Vec<String>) -> Self
pub fn with_template_names(self, template_names: Vec<String>) -> Self
Sourcepub fn with_server_url(self, server_url: &str) -> Self
pub fn with_server_url(self, server_url: &str) -> Self
Sourcepub fn with_generator_uri(self, generator_uri: &str) -> Self
pub fn with_generator_uri(self, generator_uri: &str) -> Self
Sourcepub fn with_lister_uri(self, lister_uri: &str) -> Self
pub fn with_lister_uri(self, lister_uri: &str) -> Self
Sourcepub fn with_show_list(self, show_list: bool) -> Self
pub fn with_show_list(self, show_list: bool) -> Self
Trait Implementations§
impl StructuralPartialEq for Args
Auto Trait Implementations§
impl Freeze for Args
impl RefUnwindSafe for Args
impl Send for Args
impl Sync for Args
impl Unpin for Args
impl UnwindSafe for Args
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