-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
34 lines (30 loc) · 828 Bytes
/
main.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
package main
import (
"flag"
"github.com/garrou/fd/lib"
)
func main() {
hidden := flag.Bool("i", false, "search hidden entries")
recurse := flag.Bool("r", true, "find recursively")
count := flag.Bool("c", false, "count the number of results")
pattern := flag.Bool("p", false, "search pattern")
extension := flag.String("e", "", "search files with extension")
bench := flag.Bool("b", false, "get the execution time")
exclude := flag.String("x", "", "exclude matching folders (space separated)")
entryType := flag.String("t", "", "type of searched entry (f)ile / (d)irectory")
location := flag.String("l", ".", "place to search")
flag.Parse()
walker := lib.NewWalker(
flag.Args(),
*recurse,
*hidden,
*count,
*pattern,
*bench,
*extension,
*exclude,
*entryType,
*location,
)
walker.Search()
}