Skip to content

test(cli): cover rm purge parser#98

Draft
overtrue wants to merge 1 commit intomainfrom
codex/rm-purge-parser-gap
Draft

test(cli): cover rm purge parser#98
overtrue wants to merge 1 commit intomainfrom
codex/rm-purge-parser-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented Apr 8, 2026

Summary

This adds focused parser coverage for the --purge flag introduced on rm.

The recent rm --purge work already had behavioral coverage for the delete path and a help-contract check for flag discoverability, but the CLI parser itself still had no direct assertion that the flag is accepted through both command entrypoints that share RmArgs: the legacy rc rm form and the noun-first rc object remove form.

This change adds two parser tests in crates/cli/src/commands/mod.rs that verify both entrypoints preserve the target path and set purge = true. The scope stays limited to the recent rm change surface and does not touch production code.

Root Cause

PR #82 wired --purge into RmArgs, but parser coverage in commands::tests did not exercise that new flag. That left a small regression window where clap wiring could drift for one entrypoint without a focused unit test catching it.

Validation

make pre-commit is not defined in this checkout, so I ran the repository's required checks directly:

  • cargo test -p rustfs-cli purge_flag --lib
  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant