Rename --no-define-aliases flag to --no-aliases

This commit is contained in:
Ajeet D'Souza 2020-05-03 18:09:54 +05:30
parent e0572a4569
commit 0e936fede1
1 changed files with 4 additions and 3 deletions

View File

@ -14,7 +14,7 @@ pub struct Init {
#[structopt( #[structopt(
long, long,
help = "Changes the name of the 'z' command", help = "Renames the 'z' command and corresponding aliases",
alias = "z-cmd", alias = "z-cmd",
default_value = "z" default_value = "z"
)] )]
@ -22,9 +22,10 @@ pub struct Init {
#[structopt( #[structopt(
long, long,
alias = "no-define-aliases",
help = "Prevents zoxide from defining any commands other than 'z'" help = "Prevents zoxide from defining any commands other than 'z'"
)] )]
no_define_aliases: bool, no_aliases: bool,
#[structopt( #[structopt(
long, long,
@ -51,7 +52,7 @@ impl Init {
let z = config.z; let z = config.z;
writeln!(handle, "{}", z(&self.cmd)).unwrap(); writeln!(handle, "{}", z(&self.cmd)).unwrap();
if !self.no_define_aliases { if !self.no_aliases {
let alias = config.alias; let alias = config.alias;
writeln!(handle, "{}", alias(&self.cmd)).unwrap(); writeln!(handle, "{}", alias(&self.cmd)).unwrap();
} }