andreafrancia / trash-cli

Command line interface to the freedesktop.org trashcan.
GNU General Public License v2.0
3.63k stars 177 forks source link

Why doesn't it just take a * to restore all files? #261

Open andreafrancia opened 1 year ago

andreafrancia commented 1 year ago
    Why doesn't it just take a * to restore all files?

Originally posted by @et304383 in https://github.com/andreafrancia/trash-cli/issues/63#issuecomment-388032728

andreafrancia commented 1 year ago

I don't know, what should happens if you have multiple version of the same file?

rpgoldman commented 1 day ago

I would vote for this feature. I just did a find script to trash all the files that matched a pattern, and found that the pattern also matched files in a different directory where I didn't want to get rid of them. I thought "oh, that's ok, glad I used trash instead of rm or -delete." But then I found it very difficult to get the files back.

First I tried trash-list | grep 'crs_scratch.*\.patch' | parallel trash-restore and ... trash-restore doesn't take a path name.

Then I tried trash-restore --all and selecting all the files and that didn't work either.

Having either the ability to read a path name off the command line or an --all flag would be a great addition!

rpgoldman commented 1 day ago

I apologize! I see that my post was wrong -- it was based on my sysadmin's installation of the trash package on Ubuntu 22.04, which seems not to be up-to-date!