pub struct GenerateArgs {Show 21 fields
pub template_path: TemplatePath,
pub list_favorites: bool,
pub name: Option<String>,
pub force: bool,
pub verbose: bool,
pub template_values_file: Option<String>,
pub silent: bool,
pub config: Option<PathBuf>,
pub vcs: Option<Vcs>,
pub lib: bool,
pub bin: bool,
pub ssh_identity: Option<PathBuf>,
pub gitconfig: Option<PathBuf>,
pub define: Vec<String>,
pub init: bool,
pub destination: Option<PathBuf>,
pub force_git_init: bool,
pub allow_commands: bool,
pub overwrite: bool,
pub skip_submodules: bool,
pub other_args: Option<Vec<String>>,
}
Fields§
§template_path: TemplatePath
§list_favorites: bool
List defined favorite templates from the config
name: Option<String>
Directory to create / project name; if the name isn’t in kebab-case, it will be converted
to kebab-case unless --force
is given.
force: bool
Don’t convert the project name to kebab-case before creating the directory. Note that cargo
generate won’t overwrite an existing directory, even if --force
is given.
verbose: bool
Enables more verbose output.
template_values_file: Option<String>
Pass template values through a file. Values should be in the format key=value
, one per
line
silent: bool
If silent mode is set all variables will be extracted from the template_values_file. If a value is missing the project generation will fail
config: Option<PathBuf>
Use specific configuration file. Defaults to $CARGO_HOME/cargo-generate or $HOME/.cargo/cargo-generate
vcs: Option<Vcs>
Specify the VCS used to initialize the generated template.
lib: bool
Populates template variable crate_type
with value "lib"
bin: bool
Populates a template variable crate_type
with value "bin"
ssh_identity: Option<PathBuf>
Use a different ssh identity
gitconfig: Option<PathBuf>
Use a different gitconfig file, if omitted the usual $HOME/.gitconfig will be used
define: Vec<String>
Define a value for use during template expansion. E.g --define foo=bar
init: bool
Generate the template directly into the current dir. No subfolder will be created and no vcs is initialized.
destination: Option<PathBuf>
Generate the template directly at the given path.
force_git_init: bool
Will enforce a fresh git init on the generated project
allow_commands: bool
Allows running system commands without being prompted. Warning: Setting this flag will enable the template to run arbitrary system commands without user confirmation. Use at your own risk and be sure to review the template code beforehand.
overwrite: bool
Allow the template to overwrite existing files in the destination.
skip_submodules: bool
Skip downloading git submodules (if there are any)
other_args: Option<Vec<String>>
All args after “–” on the command line.
Trait Implementations§
Source§impl Args for GenerateArgs
impl Args for GenerateArgs
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 Clone for GenerateArgs
impl Clone for GenerateArgs
Source§fn clone(&self) -> GenerateArgs
fn clone(&self) -> GenerateArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GenerateArgs
impl Debug for GenerateArgs
Source§impl Default for GenerateArgs
impl Default for GenerateArgs
Source§impl FromArgMatches for GenerateArgs
impl FromArgMatches for GenerateArgs
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
.Auto Trait Implementations§
impl Freeze for GenerateArgs
impl RefUnwindSafe for GenerateArgs
impl Send for GenerateArgs
impl Sync for GenerateArgs
impl Unpin for GenerateArgs
impl UnwindSafe for GenerateArgs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more