3 ms·
Quote: > Launch CLI to restore or flush elements: `rmt trash_display` or `rmt td` > Flush all element from the trash: `rmt trash_flush` Those need to be dash
by sph 4y ago
Quote:
> Launch CLI to restore or flush elements: `rmt trash_display` or `rmt td`
> Flush all element from the trash: `rmt trash_flush`
Those need to be dash-style options. Because if someone runs a `rmt *` in a directory and there's a trash_flush file inside, it will NOT do what one expects and will be destructive.
This is why options are traditionally prefixed with dashes. (Yeah sure, you have the same problem if you have a file that starts with dash, I already hear someone point out.)
Since you suggest to alias rm to rmt, your application needs to behave like rm and have a similar UI.
- Amine_Ztn 4y agoYou are totally right, thank you for the pertinent comment and I will correct that. This is one of the first cli's I had not thought of at all.
- rcthompson 4y agoI think the trash interaction command needs to be a different main command, actually. No matter what you call the option, someone can make a file with that name.
- vore 4y agoUsually tools support a `--` option for that, e.g. with `rm`: rm -- --file-that-looks-like-a-flag
- ben0x539 4y agorm ./--file-that-looks-like-a-flag ;) (I'm always half-tempted to suggest that a "strict mode" shell should require all paths in arguments to start with either / or ./ so that anything else is unambiguously not a file.) (I spent a bunch of time with a file named -i in my home directory, you know, just in case.)
- kevincox 4y agoI agree. rmt-flush and rmt-list would be great options.
- kseistrup 4y agoAlso, the `trash_` is redundant, so `rmt --display` et cetera is all enough (and please make short options like `-d` too).
- nextaccountic 4y agoOddly enough, https://github.com/Byron/trash-rs https://github.com/Byron/trash-rs also has this same UI issue (and is also written in Rust)
- forgotpwd16 4y agoOh, that's nice. A library providing cross-platform access to system's trash. Surprising none of the Rust-written rm alternatives used this.
- Amine_Ztn 4y agoI followed your advice and fixed the problems, I updated the readme and the deployment of the new version (0.1.2) should arrive in 1 hour. I thank you for raising these points.