Jump to page: 1 2
Thread overview
trash-d: Replacement for rm that uses the trash bin
Aug 24, 2021
rushsteve1
Aug 24, 2021
Paul Backus
Aug 24, 2021
rushsteve1
Aug 24, 2021
H. S. Teoh
Aug 24, 2021
Brian
Aug 25, 2021
russhy
Aug 25, 2021
Vladimir Panteleev
Aug 25, 2021
rushsteve1
Aug 25, 2021
Vladimir Panteleev
Aug 25, 2021
rushsteve1
Aug 25, 2021
Kagamin
Aug 25, 2021
rushsteve1
Aug 25, 2021
Paul Backus
Aug 25, 2021
rushsteve1
August 24, 2021

https://github.com/rushsteve1/trash-d

A near drop-in replacement for rm that uses the Freedesktop trash bin. Started because an acquaintance rm -rf'd his music folder and I thought there had to be a better way.

It's pretty simple and only uses the D stdlib. Been working on it in my spare time for a bit over a week and I figure it's good enough to show people.

I started this project in Bash originally but switched to D since I thought it would be a good way to learn some more (also Bash is scary). Ended up being a great choice!

Pretty new to D so feedback welcome!

August 24, 2021

On Tuesday, 24 August 2021 at 02:19:58 UTC, rushsteve1 wrote:

>

https://github.com/rushsteve1/trash-d

A near drop-in replacement for rm that uses the Freedesktop trash bin. Started because an acquaintance rm -rf'd his music folder and I thought there had to be a better way.

Looks like a nice little utility. Thanks for sharing!

One thing I would have liked to see in the README, and had to go digging through the source code for, is a list of supported command-line options. You might consider copy+pasting the output of trash --help into the README, to give readers a quick overview of its capabilities.

August 24, 2021

On Tuesday, 24 August 2021 at 02:34:54 UTC, Paul Backus wrote:

>

One thing I would have liked to see in the README, and had to go digging through the source code for, is a list of supported command-line options. You might consider copy+pasting the output of trash --help into the README, to give readers a quick overview of its capabilities.

Thanks for the suggestion, I've updated the README with the flags and a "usage" section. Doing that actually made me realize another issue with flag precedence, so thanks for helping me find that too :)

While I was in there I found another couple bugs (never ends does it?) that I quickly fixed, so I'm going to tag a new release.

August 24, 2021
On Tue, Aug 24, 2021 at 02:19:58AM +0000, rushsteve1 via Digitalmars-d-announce wrote:
> https://github.com/rushsteve1/trash-d
> 
> A near drop-in replacement for `rm` that uses the Freedesktop trash bin.  Started because an acquaintance `rm -rf`'d his music folder and I thought there had to be a better way.

Cool!


> It's pretty simple and only uses the D stdlib. Been working on it in my spare time for a bit over a week and I figure it's good enough to show people.

Very nice!


> I started this project in Bash originally but switched to D since I thought it would be a good way to learn some more (also Bash is scary). Ended up being a great choice!

Agreed, I wouldn't touch bash scripting with a 100-foot pole if I could help it.  D is much better for this sort of thing. ;-)


> Pretty new to D so feedback welcome!

Welcome!


T

-- 
The early bird gets the worm. Moral: ewww...
August 24, 2021

On Tuesday, 24 August 2021 at 02:19:58 UTC, rushsteve1 wrote:

>

https://github.com/rushsteve1/trash-d

A near drop-in replacement for rm that uses the Freedesktop trash bin. Started because an acquaintance rm -rf'd his music folder and I thought there had to be a better way.

It's pretty simple and only uses the D stdlib. Been working on it in my spare time for a bit over a week and I figure it's good enough to show people.

I started this project in Bash originally but switched to D since I thought it would be a good way to learn some more (also Bash is scary). Ended up being a great choice!

Pretty new to D so feedback welcome!

Funny seeing you here!

August 25, 2021

On Tuesday, 24 August 2021 at 02:19:58 UTC, rushsteve1 wrote:

>

https://github.com/rushsteve1/trash-d

A near drop-in replacement for rm that uses the Freedesktop trash bin. Started because an acquaintance rm -rf'd his music folder and I thought there had to be a better way.

It's pretty simple and only uses the D stdlib. Been working on it in my spare time for a bit over a week and I figure it's good enough to show people.

I started this project in Bash originally but switched to D since I thought it would be a good way to learn some more (also Bash is scary). Ended up being a great choice!

Pretty new to D so feedback welcome!

Welcome!

August 25, 2021

On Tuesday, 24 August 2021 at 02:19:58 UTC, rushsteve1 wrote:

>

https://github.com/rushsteve1/trash-d

A near drop-in replacement for rm that uses the Freedesktop trash bin. Started because an acquaintance rm -rf'd his music folder and I thought there had to be a better way.

Cool! How does it compare to the trash command from the trash-cli package?

August 25, 2021

On Tuesday, 24 August 2021 at 02:19:58 UTC, rushsteve1 wrote:

>

https://github.com/rushsteve1/trash-d

You marked all functions inline?

August 25, 2021

Thank you all for the warm welcome!


On Wednesday, 25 August 2021 at 06:11:04 UTC, Vladimir Panteleev wrote:

>

Cool! How does it compare to the trash command from the trash-cli package?

To quote the trash-cli README

>

Although the interface of trash-put seems to be compatible with rm, it has different semantics which will cause you problems. For example, while rm requires -R for deleting directories trash-put does not.

trash-d tries to mimic rm's semantics as much as possible. It also unifies all the different trash-* commands that trash-cli provides into a single one with flags. One of my goals with trash-d was to make a simpler and smaller alternative to trash-cli.

The only advantage that trash-cli has that I know of (aside from maturity at this point) is that it handles .Trash/ directories on separate drives/partitions while trash-d always moves to the one in the user's home. Both approaches are spec-compliant, so I opted for the simpler one.

August 25, 2021

On Wednesday, 25 August 2021 at 06:23:37 UTC, Kagamin wrote:

>

You marked all functions inline?

If I did then it wasn't on purpose, I was only trying to mark the handful of helper functions as inline. If you know a solution to this, that would be greatly appreciated!

« First   ‹ Prev
1 2