GO Local Alignment Fuzzy finder
Fuzzy word/text finder using Smith-Waterman algorithm for finding matches.
golaf.mov
Make sure go is installed
From within the base directory of this repository run following commands
git clone https://github.com/gwirn/golaf.git
cd golaf/src
go build -o golaf
After running the commands above, on unix systems you can either do mv golaf /usr/bin
or run echo 'alias golaf="/PATH/TO/GOLAF"' >> ~/.bashrc
(or ~/.zshrc
depending on your shell) in order to make GOLAF easier accessible.
Basic search can be done with golaf [PATTERN] [FILE | STDIN]
to search in files or in stdin.
The search can also be performed reading from StdIn with e.g. cat [FILE | STDIN] | golaf [PATTERN]
In order to fuzzy find files or directories by their name but not their content -type
has to be set to n
.
To search trough all directories starting in a given directory use the -recursive
argument (this can be used for file content and for file/directory search).
SYNOPSIS golaf [-bin] [-color] [-gapp] [-match] [-mmp] [-quality] [-recH] [-recursive] [-type] [pattern] [file ...]
-bin
include binary files in the search
-color string
color option for highlighting the found results- options: [ red green yellow blue purple cyan white ] (default "green")
-gapp int
gap penalty [NEGATIVE] (default -2)
-match int
score for a match [POSITIVE] (default 3)
-mmp int
mismatch penalty [NEGATIVE] (default -3)
-quality int
percentage of the pattern that have to match to be seen as match (default 75)
-recH
include hidden files in the search
-recursive string
root directory for recursively searching through all files (default ".")
-type string
Search type
c - search in file content
n - search for files and directories (default "c")