Today — both subcommands take file paths only. Measured on 0.10.1, load() in crates/termlens-cli/src/main.rs is std::fs::read_to_string(path) with no special case, so - is treated as a filename and fails:
$ termlens render --text - < saved.snap
termlens: -: No such file or directory (os error 2)
Why it is worth fixing — a saved screen most often arrives on a pipe: pulled out of a CI log, produced by another tool, or generated a moment earlier. - for stdin is the universal convention, and the parser already takes a &str rather than a path.
Fix — in load(), treat the path - as "read stdin to a string" and keep everything downstream unchanged. For diff, allow it for at most one of the two operands and say so plainly if both are -, since stdin can only be consumed once. Document it in the usage strings and crates/termlens-cli/README.md.
Done when
A good first contribution: one file, no architecture decisions. Start with
CONTRIBUTING.md
— §1 lists every gate you can run locally, and §3 asks that a change land
with a test. Commits are Conventional Commits and need git commit -s
(DCO). Happy to review a draft PR early.
Today — both subcommands take file paths only. Measured on 0.10.1,
load()incrates/termlens-cli/src/main.rsisstd::fs::read_to_string(path)with no special case, so-is treated as a filename and fails:Why it is worth fixing — a saved screen most often arrives on a pipe: pulled out of a CI log, produced by another tool, or generated a moment earlier.
-for stdin is the universal convention, and the parser already takes a&strrather than a path.Fix — in
load(), treat the path-as "read stdin to a string" and keep everything downstream unchanged. Fordiff, allow it for at most one of the two operands and say so plainly if both are-, since stdin can only be consumed once. Document it in the usage strings andcrates/termlens-cli/README.md.Done when
termlens render --text - < a.snapandtermlens diff a.snap - < b.snapboth work.termlens diff - -fails with a clear one-line diagnostic and exit code 2.crates/termlens-cli/tests/cli.rscovers the success and the double-stdin refusal.A good first contribution: one file, no architecture decisions. Start with
CONTRIBUTING.md
— §1 lists every gate you can run locally, and §3 asks that a change land
with a test. Commits are Conventional Commits and need
git commit -s(DCO). Happy to review a draft PR early.