🗑️ `rm` files without fear
Branch: master
Clone or download
icyphox Add link to name
Signed-off-by: Anirudh <icyph0x@pm.me>
Latest commit 60be0d2 Dec 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Some simplifying changes (#3) Nov 8, 2018
LICENSE Add license Nov 6, 2018
crap.nimble Release v0.2.3 Nov 8, 2018
readme.md Add link to name Dec 23, 2018

readme.md

rm files without fear

Why?

Ever rmed a file and instantly regretted it? Fear not, for crap is here.

How?

crap follows the FreeDesktop.org Trash spec. So instead of perma-deleting your file, crap moves it to the $XDG_DATA_HOME/Trash folder. If this environment variable isn't set, it defaults to ~/.local/share/Trash.

And obviously, this works only on Linux.

Installation

$ nimble install crap

or download the binary from the Releases page.

Tip

Alias crap to rm in your .bashrc/.zshrc. But that's kinda the point.

Usage

$ crap foo.png

$ crap *.png

$ crap a.pdf b.jpg c.mp4

Aaannddd it'll show up in your file manager's Trash.

trash

API

This package exposes a single proc: crap(path: var string)

import crap

crap("~/Pictures/*")

TODO

  • support multiple files
  • trashing dirs
  • support for other OSs (idk maybe)

Prior art

Contributing

Bad code? New feature in mind? Open an issue. Better still, learn Nim and shoot a PR

License

MIT © Anirudh Oppiliappan