summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Rodarmor <casey@rodarmor.com>2023-12-29 15:56:20 -0800
committerGitHub <noreply@github.com>2023-12-29 23:56:20 +0000
commitfc25a78826934983921ed970a2d5e431ba528315 (patch)
tree2c106ad7b9bf93e6cbb7cfad33fd9b60539d7a96
parentf3b103a2e0af6e1c12ffc5f9e00a09de000e8bb0 (diff)
Add `--format` and `--initialize` as aliases for `--fmt` and `--init` (#1802)
-rw-r--r--src/config.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 1c20aee7..d5685856 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -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(
@@ -1427,6 +1429,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"],
error: ConfigError::SubcommandArguments { subcommand, arguments },
@@ -1437,6 +1449,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"],
error: ConfigError::SubcommandArguments { subcommand, arguments },