cli
software/cli · 0 open · 12 done
Small, clean, complete. A real --help (stdout, exit 0), a shared IO helper, README + CMake reconciled (codecs in core), stale binaries cleared, and convert/pack/unpack/compose/overlay all covered. 54/54 assertions green.
Resolved 2026-06-20. The md->prisma codec emits nameless headings (def heading { ... }) after the anonymous-elements change; test.sh still asserted the old def heading "0" form, so it failed under set -e and aborted the whole suite. The assertion now checks the nameless form. The suite is green again: 25/25 assertions pass.
Resolved 2026-06-20. Added convert tests: --from json over a misleading .txt, --to prism, and exit-2 paths for unknown --from/--to, wrong positional counts, unknown flags.
Resolved 2026-06-20. Added compose (flatten a real reference, missing-file, too-many-args) and overlay (later-wins override, missing base/layer, no-layer) tests.
Resolved 2026-06-20. Added a .prisma-text bundle round-trip plus pack/unpack error paths (regular file, non-bundle, unparseable, dotfiles-only).
Resolved 2026-06-20. README fixed: real format names, compose/overlay synopsis + sections, core-only dependency; CMake dropped the bogus separate codecs requirement.
Resolved 2026-06-20. build.sh now clears its product + stale prism/prisma binaries first; build/ holds only kinogaki.
Resolved 2026-06-20. Added --help/-h/help printing usage to stdout with exit 0 via a shared printUsage(FILE*); the error path still goes to stderr with exit 2.
Resolved 2026-06-20. Hoisted readFile/writeFile into a shared src/Io.{h,cpp}; removed the duplicates from main.cpp and Pack.cpp.
Where: src/main.cpp:66
Resolution: The usage text now reads fmt = prisma | prism | json | markdown | html | svg | text | blob, exactly matching codecByName (Codecs.cpp:74-83) and codecName (Codecs.cpp:59-72). The earlier self-contradicting kinogaki value is gone, and the genuinely-valid prism name is advertised. Verified convert in out --from prism and --from prisma both parse; --from kinogaki correctly errors with exit 2. (The README at line 9 still has the old duplicated list — tracked under cli_4.) The stray comment at main.cpp:6 still says (prisma | kinogaki | text | blob), but that is an internal comment, not user-facing.
Where: src/main.cpp, src/Pack.h/.cpp, kinogaki/Codecs.h
Why clean: Argument parsing and subcommand dispatch live in main.cpp (the convert flag loop at main.cpp:184-200); format/codec policy is wholly behind core's Codecs.h (decode/encode/codecByName/codecForPath), so the CLI hardcodes no format logic; bundle filesystem recursion is isolated in Pack.cpp (packInto/unpackInto); compose/overlay delegate straight to core (composeFile, overlay). The command bodies (cmdCheck, cmdConvert, cmdPack, cmdUnpack, cmdCompose, cmdOverlay) are thin and each owns one job. No business logic leaks into main.
Fix: none.
Where: all CLI source
Why clean: Public/command functions read as verbs: readFile, writeFile, usage, cmdCheck/cmdConvert/cmdPack/cmdUnpack/cmdCompose/cmdOverlay, looksNative, looksBinary, packInto, unpackInto, sortedEntries, endsWith. The noun-named codecName/codecForPath/codecByName (from core) are conventional getters/lookups, not actions, so they are acceptable. No misleading or ambiguous names.
Fix: none.
Where: all CLI source
Why clean: Largest source file is src/main.cpp at 203 lines; Pack.cpp is 112 and Pack.h is 13 (328 total). All files are far under the 1000-line threshold. No file flagged.
Fix: none.