Struct cargo_generate::GenerateArgs

source ·
pub struct GenerateArgs {
Show 20 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 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

§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

source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can update self. Read more
source§

impl Clone for GenerateArgs

source§

fn clone(&self) -> GenerateArgs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GenerateArgs

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for GenerateArgs

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl FromArgMatches for GenerateArgs

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Any for T
where T: Any,

source§

impl<T> CloneAny for T
where T: Any + Clone,

source§

impl<T> CloneAnySend for T
where T: Any + Send + Clone,

source§

impl<T> CloneAnySendSync for T
where T: Any + Send + Sync + Clone,

source§

impl<T> CloneAnySync for T
where T: Any + Sync + Clone,