Query piped nodes when counting with -R/-F #22
Reference in New Issue
Block a user
Delete Branch "benvin/count-stdin-query"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With piped input,
-Cskipped the query and counted the piped lines' second column, so... | node-lookup -R -Creported the upstream fact instead of each node's role.-R/-Fwith-Cand count the results-Cwith piped input;-Cwith-j/-1/-2still requires-R/-FstdinReader(blockingPeek) now runs before the-R or -F must be used…validation. An invalid flag combo (e.g.-m foo) with an open, empty stdin pipe now hangs instead of erroring immediately (verified:sleep 3 | node-lookup -m footimes out; on main it errors) → run the validation first, only peek stdin after it passes (or derivepassthroughwithout peeking until needed).-C -jnow prints count lines instead of JSON (printf "a.x v1\n" | node-lookup -C -j→1: v1); thejsonModecase used to win → excludejsonModefrompassthroughor reject the combo.-Cpiped with-F(only-R), and none for the new bare--C+-1/-2/-jinteraction → add a-Fcase and pin the intended-jbehaviour.-Cwith an open but empty stdin (sleep 3 | node-lookup -C) now blocks instdinReaderPeek. On main it returned the "-R or -F must be used" error immediately. This is the no-TTY agent/CI case → decide: accept the block (same as-R), or keep it fail-fast, and add a test for whichever you pick.-Con an open-but-empty pipe, which is the one validation-before-read path that can still block.