11# Go Find
2- A file finder written in Go for my needs .
2+ A file finder written in Go.
33
4- Uses a worker pool to search through directory trees quicker and take advantage of multi-core machines.
5- Go concurrency allows it to run on single core machines.
6-
7- If you're looking for something specific you can limit the number of responses
4+ Uses a worker pool to search through directory trees quicker by taking advantage of multi-core machines.
5+ Go concurrency allows it to run on single core machines.
86
97### Features
10- - Concurrency which may speed up or slow down the search depending on the tree structure.
8+ - Concurrency search directories for desired pattern
9+ - Exit early with a max results option
1110 - Common paths are ignored to save time and checks, such as ` node_modules ` , ` .git ` , and python ` venv ` .
1211 - Searches for a pattern using basic sub-string
12+ - Use a worker pool to avoid spinning up too many go routines if there are _ many_ directories
1313
1414## Warning
1515> ** warning**
1616> Does not work on windows and I'm not trying too support this
1717
18- ## TODO
19- - [ ] user cobra for for a better cli experience
20- - [ ] sub command to print paths that are ignored
21- - [ ] create case sensative/insensative searching
22- - [ ] exclude additional directories or patters
23- - [ ] include specific patterns in the search path
24- - [ ] switch to ignore all hidden files/directories
25- - [x] can we create a worker pool instead of the number of initial directories
26- - [x] cap the number of returned responses, say 1 (quit after the first match!)
27- - [x] Auto-generate releases
28- - [ ] cap the depth of the search
29- - [x] use select statement with a fallback queue to prevent deadlock from happening
30-
3118## Using
19+ ### Usage
20+ Customise your search with the following flags
21+
22+ ``` bash
23+ Usage: goFind [OPTIONS] < pattern> < path>
24+ set pattern & path positionally or via flags
25+ -c int
26+ The maximum number of results to find (default -1)
27+ -d string
28+ The starting directory to check for files (default " ." )
29+ -i perform a case insensative search
30+ -p string
31+ A pattern to check for within the file names
32+ -q int
33+ The max work queue size (default 512)
34+ -v print the version and build information
35+ -w int
36+ Number of workers (default -1)
37+ ` ` `
38+
39+ # # Contributing
3240# ## Build
3341build with ` go build -o gf main.go` and run with ` ./gf -d < starting-path> -p < pattern-to-match-on> `
3442# ### Requirements
@@ -40,18 +48,16 @@ You can use the [makefile](./Makefile) to build a production release with `make
4048 - Make
4149 - Go 1.21+
4250
43- ### Flags
44- Customise your search with the following flags
45- ``` bash
46- Usage of ./gf:
47- -c int
48- The maximum number of results to find (default -1)
49- -d string
50- The starting directory to check for files (default " ." )
51- -p string
52- A pattern to check for within the file names
53- -q int
54- The max work queue size (default 2048)
55- -w int
56- Number of workers (default 8)
57- ```
51+ # # Roadmap
52+ - [x] can we create a worker pool instead of the number of initial directories
53+ - [x] cap the number of returned responses, say 1 (quit after the first match! )
54+ - [x] Auto-generate releases
55+ - [x] cap the depth of the search
56+ - [x] use select statement with a fallback queue to prevent deadlock from happening
57+ - [x] use postional args or flags to set the pattern/path
58+ - [ ] Add flag to print which paths will be ignored
59+ - [ ] create case sensative/insensative searching
60+ - [ ] exclude additional directories or patters
61+ - [ ] include specific patterns in the search path
62+ - [ ] switch to ignore all hidden files/directories
63+ - [ ] look for ` .gitignore` files and use contents to build ignored patterns
0 commit comments