Struct cargo_generate::Args [−][src]
pub struct Args {}Show 15 fields
pub list_favorites: bool, pub favorite: Option<String>, pub subfolder: Option<String>, pub git: Option<String>, pub branch: Option<String>, 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: Vcs, pub lib: bool, pub bin: bool, pub ssh_identity: Option<PathBuf>,
Fields
list_favorites: bool
List defined favorite templates from the config
favorite: Option<String>
Generate a favorite template as defined in the config. In case the favorite is undefined,
use in place of the --git
option, otherwise specifies the subfolder
subfolder: Option<String>
Specifies a subfolder within the template repository to be used as the actual template.
git: Option<String>
Git repository to clone template from. Can be a URL (like
https://github.com/rust-cli/cli-template
), a path (relative or absolute), or an
owner/repo
abbreviated GitHub URL (like rust-cli/cli-template
).
Note that cargo generate will first attempt to interpret the owner/repo
form as a
relative path and only try a GitHub URL if the local path doesn’t exist.
branch: Option<String>
Branch to use when installing from git
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: Vcs
Specify the VCS used to initialize the generated template.
lib: bool
Populates a 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
Trait Implementations
Builds the struct from clap::ArgMatches
. It’s guaranteed to succeed
if matches
originates from an App
generated by StructOpt::clap
called on
the same type, otherwise it must panic. Read more
Builds the struct from the command line arguments (std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program. Read more
Builds the struct from the command line arguments (std::env::args_os
).
Unlike StructOpt::from_args
, returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you. Read more
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec
of your making.
Print the error message and quit the program in case of failure. Read more
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec
of your making. Read more