Skip to content

Commit

Permalink
Add -- as a way to force arguments to be considered files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkaeriit committed Sep 14, 2022
1 parent 72cb4e9 commit b3a354c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rem.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Options:
--version print Rem version
-i/--interactive ignored, used for compatibility with rm
-r/--recursive ignored, used for compatibility with rm
-v/--verbose ignored, used for compatibility with rm`
-v/--verbose ignored, used for compatibility with rm
-- all arguments after this as considered files`
dataDir string
logFileName = ".trash.log"
logFile map[string]string
Expand Down Expand Up @@ -153,6 +154,14 @@ func main() {
if i == 0 {
continue
}
if filePath == "--" {
for j, _ := range ignoreArgs {
if j > i {
ignoreArgs[j] = false
}
}
continue
}
if !ignoreArgs[i] {
trashFile(filePath)
}
Expand Down

0 comments on commit b3a354c

Please sign in to comment.