pub struct Args {
pub template_names: Vec<String>,
pub server_url: String,
pub show_help: bool,
pub show_version: bool,
pub show_author: bool,
}Expand description
Struct to parse and gather cli args parsing result.
It should not be used directly to parse cli args, but should be
used along crate::parser::ArgsParser, which wraps all the complex
parsing logic.
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, version or help options are given.
server_url: StringThe gitignore template generator service url.
Optional value represented by the cli option
constant::cli_options::SERVER_URL that takes a string value, and
falling back to constant::template_generator::BASE_URL if 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
constant::cli_options::HELP, and falling back to false if
not provided in cli args.
show_version: boolThe boolean indicator of whether to display version infos or not.
Optional value represented by the cli option
constant::cli_options::VERSION, and falling back to false if
not provided in cli args.
The boolean indicator of whether to display author infos or not.
Optional value represented by the cli option
constant::cli_options::AUTHOR, and falling back to false if
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
Trait Implementations§
Source§impl Args for Args
impl Args for Args
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Args
impl CommandFactory for Args
Source§impl FromArgMatches for Args
impl FromArgMatches for Args
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.