Skip to content

fix: warn when only --delete-excluded is enabled - #8

Merged
KiryuuLight merged 1 commit into
devfrom
fix/delete-excluded-warning
Jul 28, 2026
Merged

KiryuuLight merged 1 commit into
devfrom
fix/delete-excluded-warning

Conversation

@KiryuuLight

Copy link
Copy Markdown
Contributor

--delete-excluded deletes files on its own — it does not need --delete — but both delete gates only ever checked flags.delete. A task with just that flag enabled showed no ⚠ in the run confirmation and got no prompt when the flag was switched on, so it could remove files at the destination with nothing warning you.

Confirmed against rsync 3.4.3: rsync -a --delete-excluded --exclude='*.log' src/ dst/, with no --delete, removed both the file missing from the source and the excluded one.

Task::destructive() now covers both flags and backs the run confirmation as well as the flag toggle. The toggle alert previously hardcoded --delete in its text and set flags.delete directly; it now carries the field index and renders the real flag name, so switching on del-excl prompts for --delete-excluded. The alert fires when a task becomes destructive rather than once per flag, so adding the second delete flag to an already-destructive task does not prompt a second time.

The confirmation list reads better too: flags are spelled out in full rather than abbreviated, aligned in a column sized to the widest task name, and the warning line is centred and capitalised.

fmt, clippy -D warnings, build and 71 tests clean.

@KiryuuLight
KiryuuLight merged commit c0a6ea4 into dev Jul 28, 2026
1 check passed
@KiryuuLight
KiryuuLight deleted the fix/delete-excluded-warning branch July 30, 2026 12:34
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