Repository navigation
Command reference overstates --force availability on mutating commands #53
Description
Problem Statement
The command reference currently overstates flag support: it says mutating commands accept both --dry-run and --force (cli-commands.md:59), but several mutating commands do not implement --force. This causes documentation/behavior drift and leads agents/users to run invalid commands.
Severity: Medium
Impact: Automation and agent suggestions include unsupported flags, causing CLI invocations to fail with argument parsing errors and making the command reference unreliable as a source of truth.
Affected Files / Lines
cli-commands.md:59(blanket statement about mutating command flags)prune.rs:13(--forcenot defined)expire.rs:14(--forcenot defined)autoclean.rs:14(--forcenot defined)init.rs:16(--forcenot defined)
Recommended Fix
Update documentation to match current implementation, and make --force support explicit per command instead of a global claim.
Suggested docs update
Mutating commands support `--dry-run`.
`--force` is command-specific and only available where explicitly documented.Add a flag matrix in cli-commands.md to prevent ambiguity:
| Command | `--dry-run` | `--force` |
|-----------|-------------|-----------|
| prune | yes | no |
| expire | yes | no |
| autoclean | yes | no |
| init | yes | no |Optional follow-up: if uniform ergonomics are desired, implement --force consistently across mutating commands in a separate issue.
Validation Strategy
Automated tests
- Add CLI integration tests asserting current behavior (unsupported
--forcefails):
Command::cargo_bin("trop")?
.args(["prune", "--force"])
.assert()
.failure()
.stderr(predicates::str::contains("unexpected argument '--force'"));- Add
--helpassertions/snapshots forprune,expire,autoclean, andinitto lock expected flags.
Manual verification
- Run:
trop prune --help trop expire --help trop autoclean --help trop init --help
- Confirm
--forceis not shown for those commands. - Run each command with
--forceand confirm parser rejection matches docs. - Recheck
cli-commands.mdto ensure no blanket--forceclaim remains.
🤖 Discovered by Codex · expanded by Codex · filed by Claude Code
Update: after review, we have added --force support to each mutating command. This means that in principle all of the mutations should not already support --force (even in cases where there are no underlying safety checks to bypass, as was the case with the commands previously lacking that flag). As such, we should still re-verify that --force exists on all subcommands, but the scenario has changed from "supported on some but not others" to "supported on all".
Activity
Fix command reference --force documentation drift (gh issue: #53)
plx commentedon Apr 9, 2026
Addressed via
2fa3a9ein PR #48Changes:
Documentation update (
cli-commands.md):--forceto per-command option lists forprune,expire,autoclean,init, andcompact-exclusions(these commands already supported--forcebut the docs omitted it)--dry-run,--force" with a precise statement and a flag matrix table covering all 11 mutating commandsscanis a special case: it can optionally mutate config via--autoexclude/--autocompactbut does not support--forceor--dry-runexcludeis the only mutating command without--dry-runCLI integration tests (16 new tests):
--forceappears in--helpfor all 11 mutating commands--dry-runappears in--helpforprune,expire,autoclean, andinitexclude --helpdoes NOT show--dry-runAll 25 CLI tests pass.
🤖 Posted by Claude Code