Skip to content

refactor(cli): replace verbose/quiet bool pairs with Verbosity enum - #553

Merged
bug-ops merged 1 commit into
mainfrom
feat/550-cli-verbosity-enum
Aug 18, 2026
Merged

refactor(cli): replace verbose/quiet bool pairs with Verbosity enum#553
bug-ops merged 1 commit into
mainfrom
feat/550-cli-verbosity-enum

Conversation

@bug-ops

@bug-ops bug-ops commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • exarch-cli's output-formatter and progress-selection code took separate verbose: bool, quiet: bool parameters, allowing the nonsensical verbose: true, quiet: true state and, in extract, resolving it inconsistently between the formatter (quiet-wins) and the progress reporter (verbose-wins).
  • output::create_formatter, HumanFormatter::new, HumanFormatter::with_writers, commands::extract::execute, and commands::create::execute now take a single output::Verbosity (Quiet | Normal | Verbose) instead, resolved once via impl From<&cli::Cli> for Verbosity in main.rs and threaded through every call site.
  • --verbose/--quiet remain independent clap flags with conflicts_with on --quiet; that check only rejects the pair when both land in the same ArgMatches level (e.g. exarch list --verbose --quiet), so a split-level combination such as exarch --verbose extract archive.tar.gz out --quiet still parses with both trueVerbosity::from_flags now resolves that case deterministically to Quiet.

Behavior change

extract's progress reporter previously selected VerboseProgress whenever --verbose was passed, even together with --quiet (verbose-wins), while the formatter suppressed the summary (quiet-wins) — so --verbose extract ... --quiet printed per-entry progress lines but no summary. Both now consistently resolve to Quiet (no progress output, no summary) through the same Verbosity value.

Closes #550

Test plan

  • cargo +nightly fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo nextest run --workspace --all-features --exclude exarch-python --exclude exarch-node (1234/1234)
  • cargo test --doc --workspace --all-features --exclude exarch-python --exclude exarch-node (117/117)
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --all-features --workspace
  • Added unit tests covering all four Verbosity::from_flags combinations, including the previously-nonsensical (true, true) case
  • Added a regression test parsing --verbose extract ... --quiet via Cli::parse_from to verify split-ArgMatches-level resolution
  • Live-verified with the built binary that exarch --verbose extract t.tar.gz out --quiet now produces no progress output and no summary, consistent with the formatter

@github-actions github-actions Bot added core Changes to exarch-core docs Documentation labels Aug 18, 2026
exarch-cli's output-formatter and progress-selection code took separate
verbose/quiet bool parameters, allowing the nonsensical verbose=true,
quiet=true state and, in extract, resolving it inconsistently between
the formatter (quiet-wins) and the progress reporter (verbose-wins).

create_formatter, HumanFormatter::new, HumanFormatter::with_writers,
commands::extract::execute, and commands::create::execute now take a
single output::Verbosity (Quiet | Normal | Verbose), resolved once via
impl From<&cli::Cli> for Verbosity and threaded through every call
site, closing the split-ArgMatches-level gap where clap's
conflicts_with does not catch --verbose and --quiet passed at
different argument levels.

Closes #550
@bug-ops
bug-ops force-pushed the feat/550-cli-verbosity-enum branch from edaac44 to b04e19f Compare August 18, 2026 18:30
@bug-ops
bug-ops enabled auto-merge (squash) August 18, 2026 18:30
@bug-ops
bug-ops merged commit aacf6e4 into main Aug 18, 2026
22 checks passed
@bug-ops
bug-ops deleted the feat/550-cli-verbosity-enum branch August 18, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to exarch-core docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: unlabeled bool params in output formatter constructors (json/verbose/quiet)

1 participant