Add --format
and --initialize
as aliases for --fmt
and --init
(#1802)
This commit is contained in:
parent
f3b103a2e0
commit
fc25a78826
@ -345,11 +345,13 @@ impl Config {
|
||||
.arg(
|
||||
Arg::with_name(cmd::FORMAT)
|
||||
.long("fmt")
|
||||
.alias("format")
|
||||
.help("Format and overwrite justfile"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name(cmd::INIT)
|
||||
.long("init")
|
||||
.alias("initialize")
|
||||
.help("Initialize new justfile in project root"),
|
||||
)
|
||||
.arg(
|
||||
@ -1426,6 +1428,16 @@ mod tests {
|
||||
},
|
||||
}
|
||||
|
||||
error! {
|
||||
name: fmt_alias,
|
||||
args: ["--format", "bar"],
|
||||
error: ConfigError::SubcommandArguments { subcommand, arguments },
|
||||
check: {
|
||||
assert_eq!(subcommand, cmd::FORMAT);
|
||||
assert_eq!(arguments, &["bar"]);
|
||||
},
|
||||
}
|
||||
|
||||
error! {
|
||||
name: init_arguments,
|
||||
args: ["--init", "bar"],
|
||||
@ -1436,6 +1448,16 @@ mod tests {
|
||||
},
|
||||
}
|
||||
|
||||
error! {
|
||||
name: init_alias,
|
||||
args: ["--initialize", "bar"],
|
||||
error: ConfigError::SubcommandArguments { subcommand, arguments },
|
||||
check: {
|
||||
assert_eq!(subcommand, cmd::INIT);
|
||||
assert_eq!(arguments, &["bar"]);
|
||||
},
|
||||
}
|
||||
|
||||
error! {
|
||||
name: show_arguments,
|
||||
args: ["--show", "foo", "bar"],
|
||||
|
Loading…
Reference in New Issue
Block a user