pub struct NewCommand {
pub name: String,
pub template: Option<String>,
pub force: bool,
}
Fields§
§name: 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.
template: Option<String>
Name of the template to create.
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.
Implementations§
Source§impl NewCommand
impl NewCommand
pub fn handle_command(&self, config: &Config) -> Result<()>
Trait Implementations§
Source§impl Clap for NewCommand
impl Clap for NewCommand
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
Source§impl Clone for NewCommand
impl Clone for NewCommand
Source§fn clone(&self) -> NewCommand
fn clone(&self) -> NewCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NewCommand
impl Debug for NewCommand
Source§impl FromArgMatches for NewCommand
impl FromArgMatches for NewCommand
Source§fn from_arg_matches(matches: &ArgMatches) -> Self
fn from_arg_matches(matches: &ArgMatches) -> Self
It’s common to have an “application context” struct (sometimes called
config) that represents all the normalized values after being processed by
the CLI. Read more
Auto Trait Implementations§
impl Freeze for NewCommand
impl RefUnwindSafe for NewCommand
impl Send for NewCommand
impl Sync for NewCommand
impl Unpin for NewCommand
impl UnwindSafe for NewCommand
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