Comparing version
19
cli.js
@@ -15,9 +15,11 @@ #!/usr/bin/env node | ||
function help() { | ||
console.log(pkg.description); | ||
console.log(''); | ||
console.log('Usage'); | ||
console.log(' $ trash <path> [<path> ...]'); | ||
console.log(''); | ||
console.log('Example'); | ||
console.log(' $ trash unicorn.png rainbow.png'); | ||
console.log([ | ||
pkg.description, | ||
'', | ||
'Usage', | ||
' $ trash <path> [<path> ...]', | ||
'', | ||
'Example', | ||
' $ trash unicorn.png rainbow.png' | ||
].join('\n')); | ||
} | ||
@@ -41,4 +43,5 @@ | ||
if (err) { | ||
throw err; | ||
console.error(err.message); | ||
process.exit(1); | ||
} | ||
}); |
{ | ||
"name": "trash", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Cross-platform command-line app for moving files and directories to the trash - A safer alternative to `rm`", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -59,4 +59,16 @@ #  | ||
## Tip | ||
Add `alias t=trash` to your `.zshrc`/`.bashrc` to reduce typing: `$ t unicorn.png`. | ||
## FAQ | ||
### But I can do the same thing with `mv` | ||
Not really. The `mv` command isn't cross-platform and moving to trash is not just about moving the file to a "trash" directory. On all OSes you'll run into file conflicts. The user won't easily be able to restore the file. It won't work on an external drive. The trash directory location varies between Windows versions. For Linux there's a whole [spec](http://www.ramendik.ru/docs/trashspec.html) you need to follow. On OS X you'll loose the [Put back](http://mac-fusion.com/trash-tip-how-to-put-files-back-to-their-original-location/) feature. | ||
## License | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) |
114733
0.59%1365
0.22%74
19.35%