andreafrancia / trash-cli

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

Add trash-list default sort by deletion date #274

Closed Susensio closed 5 months ago

Susensio commented 1 year ago

Fixes #266 I had to consume the generated list to be able to sort it and print it afterwards.

andreafrancia commented 1 year ago

Thank for your code! Can you also add a --sort={none,date} option? For now none should be the default.

Susensio commented 1 year ago

I'll look into it. I've seen that trash-restore does this sorting as well. Maybe it's a good idea to refactor both and share the code for list generation. What do you think?

andreafrancia commented 1 year ago

Choose the way you feel more comfortable with, for me is ok. If you can refactor in order to prevent duplication between trash-restore and trash-list it would be great, but is not mandatory, I can remove duplication later.

The trash-restore code for sorting of date is not tested yet. If you decide to refactor trash-restore please use extra care in checking that the sort will continue working. If you can also add test for date sorting ti would be great.

andreafrancia commented 5 months ago

Thank you, but I see some conflicts.