mirror of
https://github.com/fumiama/dupimage.git
synced 2026-06-30 00:50:29 +08:00
add -s option
This commit is contained in:
@@ -3,10 +3,13 @@ Detect duplicated images and gather each group into a unique subfolder.
|
|||||||
|
|
||||||
## usage
|
## usage
|
||||||
```powershell
|
```powershell
|
||||||
Usage: dupimage [-adht] ext1 ext2...
|
Usage: dupimage [-adhst] ext1 ext2...
|
||||||
-a action sort
|
-a action sort
|
||||||
-d string
|
-d string
|
||||||
work directory (default "./")
|
work directory (default "./")
|
||||||
|
-h display help
|
||||||
|
-s uint
|
||||||
|
folder sequence number start (exclude)
|
||||||
-t uint
|
-t uint
|
||||||
duplicate throttle, max is 64 (default 5)
|
duplicate throttle, max is 64 (default 5)
|
||||||
exts matching extensions
|
exts matching extensions
|
||||||
|
|||||||
5
main.go
5
main.go
@@ -33,6 +33,7 @@ func main() {
|
|||||||
dir := flag.String("d", "./", "work directory")
|
dir := flag.String("d", "./", "work directory")
|
||||||
a := flag.Bool("a", false, "action sort")
|
a := flag.Bool("a", false, "action sort")
|
||||||
h := flag.Bool("h", false, "display help")
|
h := flag.Bool("h", false, "display help")
|
||||||
|
s := flag.Uint("s", 0, "folder sequence number start (exclude)")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
if *h {
|
if *h {
|
||||||
fmt.Println("Usage:", os.Args[0], "[-adht] ext1 ext2...")
|
fmt.Println("Usage:", os.Args[0], "[-adht] ext1 ext2...")
|
||||||
@@ -144,13 +145,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if hasfound {
|
if hasfound {
|
||||||
j := 0
|
j := *s
|
||||||
for _, lst := range dups {
|
for _, lst := range dups {
|
||||||
if len(lst) > 0 {
|
if len(lst) > 0 {
|
||||||
j++
|
j++
|
||||||
fmt.Println("[", j, "] duplicate:", lst)
|
fmt.Println("[", j, "] duplicate:", lst)
|
||||||
if action {
|
if action {
|
||||||
newdir := strconv.Itoa(j)
|
newdir := strconv.FormatUint(uint64(j), 10)
|
||||||
err = os.MkdirAll(newdir, 0755)
|
err = os.MkdirAll(newdir, 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("ERROR:", err)
|
fmt.Println("ERROR:", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user