From df66d9fcdfdeda1c8c9d32a670c4408e23f50c16 Mon Sep 17 00:00:00 2001 From: Reilly Wood <26268125+rgwood@users.noreply.github.com> Date: Tue, 6 Dec 2022 18:20:20 -0800 Subject: [PATCH] Fix `watch` for block+closure split (#7374) The block+closure split broke `watch` for some use cases. Fixed. We should eventually add some tests for `watch` but it's a little tricky since it's an interactive command. Closes #7362. --- crates/nu-command/src/filesystem/watch.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/nu-command/src/filesystem/watch.rs b/crates/nu-command/src/filesystem/watch.rs index fb5c8bf2e0..b5edf4c002 100644 --- a/crates/nu-command/src/filesystem/watch.rs +++ b/crates/nu-command/src/filesystem/watch.rs @@ -35,7 +35,9 @@ impl Command for Watch { fn signature(&self) -> nu_protocol::Signature { Signature::build("watch") .required("path", SyntaxShape::Filepath, "the path to watch. Can be a file or directory") - .required("block", SyntaxShape::Block, "A Nu block of code to run whenever a file changes. The block will be passed `operation`, `path`, and `new_path` (for renames only) arguments in that order") + .required("closure", + SyntaxShape::Closure(Some(vec![SyntaxShape::String, SyntaxShape::String, SyntaxShape::String])), + "Some Nu code to run whenever a file changes. The closure will be passed `operation`, `path`, and `new_path` (for renames only) arguments in that order") .named( "debounce-ms", SyntaxShape::Int,