Add --dry-run flag to rm#338
Merged
Merged
Conversation
821ba12 to
de9013a
Compare
Add a --dry-run flag that previews deletions without mutating anything. Dry-run still runs the existing validation (e.g. non-empty folder checks) but skips the DeleteV2 / PermanentlyDelete API calls, reports a "planned" JSON status, and prints "Would delete" / "Would permanently delete" in text mode. Dry-run behavior lives in a shared cmd/dry_run.go so future commands can reuse it: addDryRunFlag/dryRunEnabled register and read the flag, plannedStatus collapses a real status to "planned", and writeDryRunLine renders the "Would <verb> <path>" text. Updates the help manifest, JSON contract, input/definition schemas, and docs to include the dry_run input and planned status.
de9013a to
85a93f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
--dry-runflag todbxcli rmthat previews deletions without mutating anything. Dry-run still runs the existing validation (e.g. non-empty folder checks) but skips theDeleteV2/PermanentlyDeleteAPI calls, reports aplannedJSON status, and printsWould delete/Would permanently deletein text mode.Dry-run behavior is factored into a shared
cmd/dry_run.goso future commands can reuse it:addDryRunFlag/dryRunEnabledregister and read the flagplannedStatuscollapses a real status toplannedwhen dry-run is setwriteDryRunLinerenders theWould <verb> <path>textThe help manifest, JSON contract, input/definition schemas, and docs are updated to include the
dry_runinput andplannedstatus.Test plan
go build ./...andgo test ./cmd/passrm --dry-run,--dry-run --output json,--dry-run --permanent, and multi-target all print the planrmconfirmed still deletes afterward