Tidied up readme.

This commit is contained in:
Bruce Hill 2020-04-07 20:57:18 -07:00
parent bf676d46f2
commit f0e1ae3f88
2 changed files with 71 additions and 44 deletions

44
README
View File

@ -1,44 +0,0 @@
bashtrash - a bash-shell implementation of the Freedesktop.org
trashcan specification.
This project was originally a quick hack to show that one could
implement a compliant trashcan utility using bash and standard Unix
commands. It has evolved to have options to make it a (somewhat)
compatible as a replacement for rm.
It requires the following utilities:
awk
basename
bash
cat
getopt
mkdir
mktemp
mv
sed
Usage: trash [OPTION]... FILE...
Move files into the trash.
Options:
--version show program's version number and exit
-h show this help message and exit
-v explain what is being done
-i prompt before moving every file
-r, -R ignored (for compatability with rm)
-f ignore non-existent files, never prompt
Copyright (c) 2009-2011, Robert Rothenberg <robrwo@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

71
README.md Normal file
View File

@ -0,0 +1,71 @@
# trashsh - Console trash management
`trashsh` is a POSIX shell implementation of the Freedesktop.org trashcan
specification. It lets you run `trash <file>` to move a file to the trash
instead of just `rm <file>`, which permanently deletes it immediately. Later,
the file can be recovered with `trash -u <file>` or permanently erased with
`trash -e <file>`. More details are in the Usage section. This is based off of
[bashtrash](https://github.com/robrwo/bashtrash), but with a few more features
and a little bit cleaned up and tweaked to be fully POSIX-compliant, rather
than relying on bashisms.
## Requirements
`trashsh` requires the following utilities in addition to the standard tools
(`mv`, `rm`, etc.):
* awk
* basename
* date
* df
* du
* dirname
* find
* mktemp
* perl (only used to URL encode filenames)
* readlink
* sed
* stty
* tput
Optionally, if you install my other tools `ask` and `arg`, you'll get slightly
nicer behavior, although `trash` should work perfectly fine without them.
(ask)[https://bitbucket.org/spilt/ask] will get you slightly cleaner
confirmation prompts, and (arg)[https://bitbucket.org/spilt/arg] will get more
robust command line flag parsing (without `arg`, you must use `trash -f -v -E`
instead of `trash -fvE`).
## Usage
Basic usage: `trash [OPTIONS]... FILES...`
Options:
* `-h`, `--help` Show the program usage and exit
* `-V`, `--version` Show program's version number and exit
* `-v`, `--verbose` Explain what is being done
* `-i`, `--interactive` Prompt before moving every file
* `-f`, `--force` Ignore non-existent files, never prompt
* `-r`, `-R`, `--recursive` Ignored (for compatability with `rm`)
* `-u`, `--untrash` Restore file(s) from the trash
* `-e`, `--empty` Choose files to empty from the trash
* `-E`, `--empty-all` Empty all the files in the trash folder(s) (default: ~)
* `-l`, `--list` List files in trash folder(s) (default: ~)
* `--` Any arguments after `--` will be treated as filenames
See `man trash` for full documentation.
## License
Copyright (c) 2020, Bruce Hill <bruce@bruce-hill.com>
Copyright (c) 2009-2011, Robert Rothenberg <robrwo@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.