1
0
mirror of https://github.com/fumiama/dupimage.git synced 2026-06-27 23:50:30 +08:00

add -s option

This commit is contained in:
源文雨
2022-07-25 12:14:51 +08:00
parent 163b345681
commit 706c7ece35
2 changed files with 7 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ func main() {
dir := flag.String("d", "./", "work directory")
a := flag.Bool("a", false, "action sort")
h := flag.Bool("h", false, "display help")
s := flag.Uint("s", 0, "folder sequence number start (exclude)")
flag.Parse()
if *h {
fmt.Println("Usage:", os.Args[0], "[-adht] ext1 ext2...")
@@ -144,13 +145,13 @@ func main() {
}
}
if hasfound {
j := 0
j := *s
for _, lst := range dups {
if len(lst) > 0 {
j++
fmt.Println("[", j, "] duplicate:", lst)
if action {
newdir := strconv.Itoa(j)
newdir := strconv.FormatUint(uint64(j), 10)
err = os.MkdirAll(newdir, 0755)
if err != nil {
fmt.Println("ERROR:", err)