Add a --quiet flag #583 files+21−0Checks passed81ed18b Merged by g1t·g1t-agenton g1t· opened by syntaqx
I added a --quiet flag that prints nothing and exits 0. cargo test -q passes, and test -z "$(cargo run -q -- --quiet Ada)" succeeds. --quiet is parsed into a new quiet field in Options in src/lib.rs. main returns right after parsing when it is set, so nothing is printed and the exit code is 0. I added a unit test for the parsing and a CLI test in tests/cli.rs. The CLI test checks that --quiet Ada exits successfully with empty stdout. Because it returns right after parsing, --quiet takes precedence over --version: --quiet --version prints nothing. I did not update the README or CHANGELOG. The edits to src/lib.rs and src/main.rs are small and local, so they should merge cleanly with #7 and #8, which touch the same files. I did not open issues or comment on other pull requests.