andreafrancia / trash-cli

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

trash-restore ranges syntax is broken #198

Closed humleflue closed 3 years ago

humleflue commented 3 years ago

Describe the bug When I try to use ranges with the trash-restore command, like in the example from the readme:

$ trash-restore
0 2007-08-30 12:36:00 /home/andrea/foo
1 2007-08-30 12:39:41 /home/andrea/bar
2 2007-08-30 12:39:41 /home/andrea/bar2
3 2007-08-30 12:39:41 /home/andrea/foo2
What file to restore [0..3]: 0-2, 3
$ ls foo bar bar2 foo2
foo bar bar2 foo2

I get Invalid entry as response.

trash-cli version Output of: trash-put --version trash-put 0.17.1.14

Operating system:

To Reproduce Copy and paste the commands (and their output) to execute in order to reproduce the behavior:

$ trash-restore
   0 2021-04-03 12:20:44 /mnt/c/GitRepos/P4/ANTLR/src/Compiler/AntlrGenerated/Lang.interp
   1 2021-04-03 12:20:44 /mnt/c/GitRepos/P4/ANTLR/src/Compiler/AntlrGenerated/Lang.tokens
   2 2021-04-03 12:20:45 /mnt/c/GitRepos/P4/ANTLR/src/Compiler/AntlrGenerated/LangBaseVisitor.java
   3 2021-04-03 12:20:45 /mnt/c/GitRepos/P4/ANTLR/src/Compiler/AntlrGenerated/LangLexer.interp
   4 2021-04-03 12:20:45 /mnt/c/GitRepos/P4/ANTLR/src/Compiler/AntlrGenerated/LangLexer.java
   5 2021-04-03 12:20:45 /mnt/c/GitRepos/P4/ANTLR/src/Compiler/AntlrGenerated/LangLexer.tokens
   6 2021-04-03 12:20:45 /mnt/c/GitRepos/P4/ANTLR/src/Compiler/AntlrGenerated/LangListener.java
   7 2021-04-03 12:20:45 /mnt/c/GitRepos/P4/ANTLR/src/Compiler/AntlrGenerated/LangParser.java
   8 2021-04-03 12:20:46 /mnt/c/GitRepos/P4/ANTLR/src/Compiler/AntlrGenerated/LangVisitor.java
What file to restore [0..8]: 0-4
Invalid entry

Expected behavior I expect the files to be restored to their original location.

andreafrancia commented 3 years ago

You're using and old version of trash-cli. trash-restore learned ranges only in version 0.20.12.26. See https://github.com/andreafrancia/trash-cli/blob/master/HISTORY.txt

I suggest you installing a the latest version of trash-cli.

humleflue commented 3 years ago

Okay thanks. I installed with sudo apt install trash-cli. I wonder why I didnt get the latest version.

But thanks again.

andreafrancia commented 3 years ago

Because your Distribution (Debian, Ubuntu or whatever) did not packaged the last version of trash-cli. Use this:

sudo apt remove trash-cli
pip install trash-cli
humleflue commented 3 years ago

Cheers!