Problem
There is no [[bin]] target in Cargo.toml — mrrc is a library only. A small CLI would be a high-leverage showcase for the Rust core, support simple interactive use by catalogers and data engineers, and demonstrate real-world API ergonomics.
What to do
- Add a binary target to
Cargo.toml (either src/bin/mrrc.rs single-file, or a separate mrrc-cli crate in a new workspace member if we want to keep CLI deps out of the library).
- Use
clap v4 with derive for arg parsing.
- Subcommands:
mrrc cat <file> — print records in human-readable form (line-mode/.mrk style ideally, so this depends on or precedes bead for .mrk support)
mrrc convert <input> <output> — convert between formats (autodetect by extension: .mrc, .xml, .json, .mrk, .csv, .ttl for BIBFRAME Turtle)
mrrc validate <file> — run all validators (IndicatorValidator, IsbnValidator, RecordStructureValidator, EncodingValidator), emit report to stdout or file
mrrc stats <file> — record count, tag-frequency histogram, encoding breakdown, average record size
- Global flags:
--recovery-mode {strict,lenient,permissive}, --output-format {text,json}, --quiet, --verbose.
- Integration tests using
assert_cmd + predicates under tests/cli.rs.
- Document CLI in
docs/cli.md with example invocations.
- Update README with a CLI section showing the most common use:
mrrc convert input.mrc output.xml.
Done when
mrrc binary builds and installs via cargo install mrrc
- All four subcommands work on the test fixtures
mrrc --help and each subcommand's --help are self-documenting
- Integration tests cover each subcommand's happy path and at least one error path
- README shows CLI examples
docs/cli.md with examples for each subcommand
- CHANGELOG entry under next version
.cargo/check.sh passes (including the binary target)
Bead: bd-e24e
Problem
There is no
[[bin]]target inCargo.toml— mrrc is a library only. A small CLI would be a high-leverage showcase for the Rust core, support simple interactive use by catalogers and data engineers, and demonstrate real-world API ergonomics.What to do
Cargo.toml(eithersrc/bin/mrrc.rssingle-file, or a separatemrrc-clicrate in a new workspace member if we want to keep CLI deps out of the library).clapv4 with derive for arg parsing.mrrc cat <file>— print records in human-readable form (line-mode/.mrk style ideally, so this depends on or precedes bead for .mrk support)mrrc convert <input> <output>— convert between formats (autodetect by extension: .mrc, .xml, .json, .mrk, .csv, .ttl for BIBFRAME Turtle)mrrc validate <file>— run all validators (IndicatorValidator, IsbnValidator, RecordStructureValidator, EncodingValidator), emit report to stdout or filemrrc stats <file>— record count, tag-frequency histogram, encoding breakdown, average record size--recovery-mode {strict,lenient,permissive},--output-format {text,json},--quiet,--verbose.assert_cmd+predicatesundertests/cli.rs.docs/cli.mdwith example invocations.mrrc convert input.mrc output.xml.Done when
mrrcbinary builds and installs viacargo install mrrcmrrc --helpand each subcommand's--helpare self-documentingdocs/cli.mdwith examples for each subcommand.cargo/check.shpasses (including the binary target)Bead: bd-e24e