diff --git a/src/config.rs b/src/config.rs index 1c20aee..d568585 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( @@ -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"],