mihai-dinculescu/cargo-wipe

Feature suggestion: Add argument to allow a particular path to be excluded

Closed this issue · 6 comments

wezm commented

E.g. cargo wipe -w -e Projects/bar/target would preserve the Projects/bar/target directory. This would allow me to run cargo-wipe in me projects directory but skip deletion of a small number of projects.

This definitely sounds like a good thing to have, but I wonder, wouldn't it be better covered by #10 and #7?

wezm commented

I think my particular use case (which you are free to ignore) would be to periodically run cargo wipe in my Projects directory and I'd always want to exclude the same projects. Due to this I'd likely just rely on my shell history to re-run it: wipe ↑<Enter> The other proposals would not quite make this as easy or predictable.

Ah, I see. I do agree that it makes sense to have it as a separate feature.

It's possible that it might integrate nicely in the future with #10. The interactive mode could come with a setting that stores the skipped folders in a file, and that file could then be used as an exclusion list. But this sounds like future, future stuff.

Coming back to the exclusion feature, I see three options that could be valuable:

  • individual excludes
cargo wipe -w -e Projects/foo/target -e Projects/foo/target -e Project/baz/target
  • path excludes
cargo wipe -w -e Projects
  • from file excludes
cargo wipe -w -e excludes.txt

Probably it makes sense to start with just the first two.

wezm commented

Probably it makes sense to start with just the first two.

Yep, the first one would work fine for what I'm trying to do.

I've started working on it.

Closing this as the main feature was shipped. The remaining work will be addressed in #16.