-
Notifications
You must be signed in to change notification settings - Fork 0
/
zindex.go
48 lines (30 loc) · 867 Bytes
/
zindex.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
zindex scans a directory of zip files and creates a Windows shortcut to the files within resolving duplicates
*/
package main
import "fmt"
import "os"
import "log"
import "flag"
import "time"
var flagVerbose bool
var flagQuiet bool
var flagTestOnly bool
func main() {
flag.BoolVar(&flagVerbose, "v", false, "Prints detailed operations")
flag.BoolVar(&flagQuiet, "q", false, "No output apart from errors")
flag.BoolVar(&flagTestOnly, "t", false, "Test only do not change")
flag.Parse()
//items := []string{"."} // default arguments to use if omitted
if flag.NArg() < 2 {
flag.PrintDefaults()
return
}
start := time.Now()
fmt.Printf("source dir %s\n" , cflag.Args[0])
fmt.Printf("target dir %s\n" , cflag.Args[1])
if !flagQuiet {
elapsed := time.Since(start)
fmt.Printf("Processed %d total items in %v\n" , total, elapsed)
}
}