Skip to content

Commit 81d2586

Browse files
committed
document watch -d
1 parent ae171d7 commit 81d2586

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

hooks/pre-commit

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,26 @@ sudo systemctl restart redis; await 'socat -u OPEN:/dev/null UNIX-CONNECT:/tmp/r
100100
101101
<img src='demo/6.gif' width='100%'></img>
102102
103+
### Watch command output with diff highlighting
104+
\`\`\`bash
105+
# Like watch -d, highlight only the changing parts
106+
await 'date +%s' --diff --forever --stdout --silent --interval 1000
107+
108+
# Monitor API responses and highlight changes
109+
await 'curl -s https://api.example.com/status | jq .counter' --diff --forever --stdout --silent
110+
111+
# Watch file changes with visual diff
112+
await 'wc -l *.log' --diff --change --forever --stdout
113+
\`\`\`
114+
115+
### Better stderr handling
116+
\`\`\`bash
117+
# Suppress stderr without affecting pipes or command structure
118+
await 'curl -s https://unreliable-api.com || echo "failed"' --no-stderr
119+
120+
# Clean output even with noisy commands
121+
await 'some-verbose-command' 'another-command' --no-stderr --stdout --silent
122+
\`\`\`
103123
104124
## --help
105125
\`\`\`bash

0 commit comments

Comments
 (0)