Skip to content

Commit

Permalink
Ready for ship
Browse files Browse the repository at this point in the history
  • Loading branch information
quackduck committed Feb 11, 2021
1 parent 501373d commit da6edbc
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ brews:

# Your app's description.
# Default is empty.
description: 'CHANGEME'
description: 'Rem is a CLI Trash which makes it ridiculously easy to recover them.'
74 changes: 74 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
# Rem

Get some rapid-eye-movement sleep knowing your files are safe.

## What is Rem?

Rem is a CLI trash which makes it _ridiculously_ easy to recover them.

## Demo

[![asciicast](https://asciinema.org/a/390479.svg)](https://asciinema.org/a/390479)

Let's say we have the following file structure
```text
.
├── someDir
│ └── someFile
└── someFile
```

Next, we want to delete `someDir`. Simple!

```shell
rem someDir
```

Now it looks like this:
```text
.
└── someFile
```
Oh no! We actually needed that directory!
```shell
rem --undo someDir
```
Back to:
```text
.
├── someDir
│ └── someFile
└── someFile
```
It's really _that_ easy.

You can also delete files of the same name with no problem:
```shell
rem someDir/someFile someFile
```

## Installing
Build from source or use:
```shell
brew install quackduck/tap/rem
```
## Uninstalling
Simply remove the executable or use:
```shell
brew uninstall rem
```

Rem stores its trash by default at `~/.remTrash`.

## Usage

```text
Usage: rem [-t/--set-trash <dir>] [--permanent | -u/--undo] file
rem [-d/--directory | --empty | -h/--help | -v/--version | -l/--list]
Options:
-u/--undo restore a file
-l/--list list files in trash
--empty empty the trash permanently
--permanent delete a file permanently
-d/--directory show path to trash
-t/--set-trash <dir> set trash to dir and continue
-h/--help print this help message
-v/--version print Rem version
```
Empty file removed lol
Empty file.
4 changes: 2 additions & 2 deletions rem.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Options:
home, _ = os.UserHomeDir()
trashDir = home + "/.remTrash"
logFileName = ".trash.log"
logSeparator = " ==> "
logSeparator = "\t==>\t"
)

func main() {
Expand Down Expand Up @@ -208,7 +208,7 @@ func trashFile(path string) {
fmt.Println("No way. This is super unlikely. Please contact my creator at igoel.mail@gmail.com or on github @quackduck and tell him what you were doing.")
} else if i == 2 { // milliseconds are same
toMoveTo = trashDir + "/" + filepath.Base(path) + " Deleted at " + time.Now().Format(time.StampMicro)
fmt.Println("What the actual heck. Please contact my creator at igoel.mail@gmail.com or on github @quackduck and tell him what you were doing.")
fmt.Println("What the actual heck. Please contact him.")
} else if i == 3 { // microseconds are same
toMoveTo = trashDir + "/" + filepath.Base(path) + " Deleted at " + time.Now().Format(time.StampNano)
fmt.Println("You are a god.")
Expand Down

0 comments on commit da6edbc

Please sign in to comment.