refactor(noteshrink): take input + output positional like the other subcommands #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/noteshrink-single-file"
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?
noteshrinkpreviously took N positional inputs plus--output-dir/--basename/--pdf/--global-palette/--no-sort, while every other subcommand follows the simpler<INPUT> <OUTPUT>shape. The mismatch tripped users up:monkey noteshrink in.png out.pngsilently treated "out.png" as a second input and wrotepage0000.pngandpage0001.pnginto the current directory. The same flag soup also produced confusing clap errors when single-dash long flag names collided with the shorts that the multi-file flags brought along.This change drops the multi-file mode entirely:
Remaining flags:
--value-threshold,--sat-threshold,--num-colors,--sample-fraction,--white-bg,--no-saturate,--quiet(with the existing short forms).Removed:
--output-dir,--basename,--pdf,--global-palette,--no-sort.sort_filenames_numerically,build_global_palette,assemble_pdf,miniz_compress, and the related loop /outputsaccumulator inrun.flate2andlopdfstay inCargo.tomlbecausepdf::extract_imagesstill uses them. Multi-page batch is now a shell loop:PDF assembly was a thin convenience over per-page output and is gone for now; it can come back as its own subcommand later if it earns its keep.
Local checks pass:
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo build --all-targets,cargo test(39 passing, 2 ignored). End-to-end smoke test against amagick-generated input produced a correctly-quantised paletted PNG.Test plan
monkey noteshrink scan.png out.png --num-colors 4 --white-bgon a real scan and confirm the output is reasonable.monkey noteshrink --helpshows only the new flag set.Checkworkflow passes for this branch.