You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Passthrough mode and `--shell` use built-in command adapters first.
74
86
- Known outputs, inline scripts, and output redirects are filtered out of the watch set.
87
+
- Search adapters such as `rg`, `ag`, and `fd` watch explicit search roots and file-valued pattern/ignore inputs without treating patterns, globs, or type filters as watched paths.
88
+
- Schema/codegen adapters such as `protoc`, `flatc`, `thrift`, and `capnp compile` watch source files plus include/import roots while filtering output directories and generated artifacts.
75
89
- Safe pathless defaults are intentionally narrow: `ls`, `dir`, `vdir`, `du`, and `find`.
76
90
- If `with-watch` cannot infer safe filesystem inputs, it fails instead of guessing.
77
91
@@ -87,10 +101,10 @@ Dedicated built-in adapters and aliases:
Copy file name to clipboardExpand all lines: crates/with-watch/README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ It executes the delegated command once immediately after input inference, watche
7
7
## Why use
8
8
9
9
- Keep familiar POSIX/coreutils-style commands while adding automatic reruns.
10
-
- Let `with-watch` infer watched inputs for common read/write utilitiessuch as `cat`, `cp`, `sed`, and `find`.
10
+
- Let `with-watch` infer watched inputs for common read/write utilities, search tools, and schema/codegen commands such as `cat`, `rg`, `fd`, `protoc`, and `find`.
11
11
- Fall back to explicit `exec --input` globs when inference would be ambiguous or when the delegated command has no meaningful filesystem inputs.
12
12
13
13
## Install
@@ -57,7 +57,9 @@ with-watch cat input.txt
57
57
with-watch --clear cat input.txt
58
58
with-watch cp src.txt dest.txt
59
59
with-watch ls -l
60
+
with-watch rg TODO src
60
61
with-watch --shell 'cat src.txt | grep hello'
62
+
with-watch protoc -I proto proto/service.proto --go_out gen
61
63
with-watch sed -i.bak -e 's/old/new/' config.txt
62
64
with-watch exec --input 'src/**/*.rs' -- cargo test -p with-watch
- Passthrough and shell modes use built-in command adapters before falling back to conservative path heuristics.
68
70
- Known outputs, inline scripts, patterns, and shell output redirects are filtered out of the watch set.
71
+
- Search adapters such as `rg`, `ag`, and `fd` watch explicit search roots and file-valued pattern/ignore inputs without treating patterns, globs, or type filters as watched paths.
72
+
- Schema/codegen adapters such as `protoc`, `flatc`, `thrift`, and `capnp compile` watch source files plus include/import roots while filtering output directories and generated artifacts.
69
73
- Pathless defaults are intentionally narrow: only `ls`, `dir`, `vdir`, `du`, and `find` implicitly watch the current directory.
70
74
- `ls`-style commands watch directory listings via metadata snapshots: plain `ls` watches immediate children, `ls -R` stays recursive, and `ls -d` watches only the named path.
71
75
- `exec --input`remains the explicit escape hatch when a delegated command has no meaningful filesystem inputs or when fallback inference would be ambiguous.
@@ -82,10 +86,10 @@ Dedicated built-in adapters and aliases:
0 commit comments