Skip to content

Commit

Permalink
Fix watch for block+closure split (#7374)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rgwood committed Dec 7, 2022
1 parent 1af1e0b commit df66d9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/nu-command/src/filesystem/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit df66d9f

Please sign in to comment.