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(
|
||||||
Arg::with_name(cmd::FORMAT)
|
Arg::with_name(cmd::FORMAT)
|
||||||
.long("fmt")
|
.long("fmt")
|
||||||
|
.alias("format")
|
||||||
.help("Format and overwrite justfile"),
|
.help("Format and overwrite justfile"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(cmd::INIT)
|
Arg::with_name(cmd::INIT)
|
||||||
.long("init")
|
.long("init")
|
||||||
|
.alias("initialize")
|
||||||
.help("Initialize new justfile in project root"),
|
.help("Initialize new justfile in project root"),
|
||||||
)
|
)
|
||||||
.arg(
|
.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! {
|
error! {
|
||||||
name: init_arguments,
|
name: init_arguments,
|
||||||
args: ["--init", "bar"],
|
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! {
|
error! {
|
||||||
name: show_arguments,
|
name: show_arguments,
|
||||||
args: ["--show", "foo", "bar"],
|
args: ["--show", "foo", "bar"],
|
||||||
|
Loading…
Reference in New Issue
Block a user