andreafrancia / trash-cli

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

feature request: make `trash` a subcommand multiplexer instead of an overload of `trash-put` #201

Closed pabs3 closed 3 years ago

pabs3 commented 3 years ago

I think the trend of having a short primary command name that is a multiplexer for different subcommands is very ergonomic on the command-line. For example git has git commit, git push etc.

I think it would be nice to have trash similarly be a subcommand multiplexer, but still allow for trash foo.txt to call the put subcommand by default.

andreafrancia commented 3 years ago

What if you wanna trash a file named empty?

pabs3 commented 3 years ago

The trash command could detect that its argument is both a file and a subcommand then either exit with an error or alternatively assume that the argument being a file overrides it being a subcommand and trash the empty or put etc files. The first option would be safer and more explicit, while the second option would be more compatible with the current behaviour.

-- bye, pabs

https://bonedaddy.net/pabs3/

andreafrancia commented 3 years ago

I don't like the idea that a command change semantic according which file is in the file system.

pabs3 commented 3 years ago

That was an idea for how to transition from the current trash command to becoming solely a multiplexer. You could deprecate trash file.txt, make it still work but print a warning and later remove it.

-- bye, pabs

https://bonedaddy.net/pabs3/