diff --git a/crates/nu-command/src/system/which_.rs b/crates/nu-command/src/system/which_.rs index f5123dd3b6..297c7f13ec 100644 --- a/crates/nu-command/src/system/which_.rs +++ b/crates/nu-command/src/system/which_.rs @@ -14,8 +14,7 @@ impl Command for Which { Signature::build("which") .input_output_types(vec![(Type::Nothing, Type::table())]) .allow_variants_without_examples(true) - .required("application", SyntaxShape::String, "Application.") - .rest("rest", SyntaxShape::String, "Additional applications.") + .rest("applications", SyntaxShape::String, "Application(s).") .switch("all", "list all executables", Some('a')) .category(Category::System) } diff --git a/crates/nu-command/tests/commands/which.rs b/crates/nu-command/tests/commands/which.rs index 45fdbf59d9..eb92595e14 100644 --- a/crates/nu-command/tests/commands/which.rs +++ b/crates/nu-command/tests/commands/which.rs @@ -105,3 +105,16 @@ fn do_not_show_hidden_commands() { let length: i32 = actual.out.parse().unwrap(); assert_eq!(length, 0); } + +#[test] +fn which_accepts_spread_list() { + let actual = nu!( + cwd: ".", // or any valid path + r#" + let apps = [ls]; + $apps | which ...$in | get command.0 + "# + ); + + assert_eq!(actual.out, "ls"); +}