Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ tmux attach -t my-agent
| `watch` | `--cli=claude` | CLI whose patterns classify the output; if no pattern set exists for the name (and none in `--patterns-dir`), pluk warns once on stderr and emits only `raw_output` (exit 0). `pluk patterns --cli=<name>` reports `no pattern set for <name>` and lists the available names |
| `watch` | `--filter=type1,type2` | Emit only the listed event types (also accepted by `subscribe`); unknown or empty entries exit 2 |
| `watch` | `--include-raw` | Also emit `raw_output` events |
| `watch` | `--capture[=ms]` | Instead of reading stdin, poll `tmux capture-pane` and classify each whole rendered frame; useful for TUIs whose pipe-pane stream has no line feeds. Interval in milliseconds, default `1000`. With `--include-raw`, `raw_output` `data.line` is a whole ANSI-stripped screen |
| `watch` | `--capture[=ms]` | Instead of reading stdin, poll `tmux capture-pane` and classify each whole rendered frame; useful for TUIs whose pipe-pane stream has no line feeds. Interval in milliseconds (positive integer), default `1000`. With `--include-raw`, `raw_output` `data.line` is a whole ANSI-stripped screen |
| `watch` | `--pane=<target>` | tmux pane to poll in `--capture` mode (defaults to the session name) |
| `watch` | `--patterns-dir=<dir>` | Load pattern files from this directory |
| `patterns` | `--patterns-dir=<dir>` | Show the patterns loaded from this directory (same lookup as `watch`) |
Expand Down
1 change: 1 addition & 0 deletions changelog.d/fixed-291.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `pluk watch --capture=<ms>` now rejects fractional intervals such as `--capture=1.5`, accepting only positive integers as documented (#291).
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function cmdWatch(args: string[]): void {
}
if (capture !== undefined && capture !== 'true') {
captureIntervalMs = Number(capture);
if (!Number.isFinite(captureIntervalMs) || captureIntervalMs <= 0) {
if (!Number.isInteger(captureIntervalMs) || captureIntervalMs <= 0) {
console.error(`${paintStderr(ANSI_RED, 'Error:')} --capture expects a positive integer number of milliseconds`);
process.exit(2);
}
Expand Down
2 changes: 1 addition & 1 deletion test/cli-watch-guard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test('run-tests.mjs propagates the child suite exit status', () => {

// --- watch: invalid --capture interval is rejected -------------------------------

for (const bad of ['0', '-5', 'abc', '']) {
for (const bad of ['0', '-5', 'abc', '', '1.5']) {
test(`watch --capture=${bad} exits 2 with a usage error`, () => {
const { code, stderr } = run(CLI, ['watch', 'x', `--capture=${bad}`]);
assert.equal(code, 2);
Expand Down
Loading