summaryrefslogtreecommitdiffstats
path: root/rsnix/src/klog.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-01 13:14:07 +0200
committersalmonik <salmonik@tuta.io>2026-08-01 13:14:07 +0200
commit6eb14b64209b9d24554c587f610d7e300ef809ea (patch)
treec308507a2140680eb82fdb8b360aa346e7c5c9fe /rsnix/src/klog.rs
parentBump workspace to edition 2024 (diff)
downloadrs-dos-6eb14b64209b9d24554c587f610d7e300ef809ea.tar.gz
rs-dos-6eb14b64209b9d24554c587f610d7e300ef809ea.zip
shell: keyword redirection + post-filter flags (ADR 0002)
Implement the shell experience redesign: one canonical grammar for every command — 'cmd args [USE src] [TIL marker] [filters...] [output kw dst]'. - Keyword redirection (uppercase-only, aliases valid, fully reserved): WRITING/WRITE overwrite, TO append, USE/USING input source, TIL/UNTIL heredoc/terminator (exact full-line marker). > >> < << are removed; '>' is plain text. - Post-filter stages applied left to right over a line stream, each repeatable: -h N (head kills the upstream), -t N (tail holds a rolling window, flushes at EOF/^C), -g PAT (smart-case literal substring), -p (screenful pager, terminal only). A file sink replaces the screen; -p is a no-op with one. - C-style quoting: "..." groups and literalizes, \x escapes one char; quoted/escaped text is never an operator, never split. - Input consumers: cat/hexdump, path-less only (stdin until ^D, USE f, TIL m heredoc, USE f TIL m truncation). Other commands reject input keywords; paths + input keyword is a syntax error. - ^D is EOF everywhere and never powers off; poweroff/exit are the only shutdown verbs. - help rewritten; test-disk.sh and sendkeys.py use the keyword syntax. Verified in QEMU: 26 grammar checks on fresh and reused disks, disk round trip, pager pacing, -h stopping /dev/mem at N lines, ^C flushing a -t window. Two bugs found during verification and fixed: 1. WRITING over an existing file wrote after stale NUL padding — fs::size() is stale after set_len(0); the sink writes at offset 0 after truncation. 2. USE f TIL m leaked the post-marker remainder — the final partial-line emit ran after the marker break; guarded with a stopped flag.
Diffstat (limited to 'rsnix/src/klog.rs')
0 files changed, 0 insertions, 0 deletions