Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
gwirn committed Aug 24, 2023
1 parent a2a9a24 commit 970b4a4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/golaf
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,34 @@ Fuzzy word/text finder using [Smith-Waterman algorithm](https://en.wikipedia.org

Make sure go is [installed](https://go.dev/doc/install)

From within the base directory run following commands
From within the base directory of this repository run following commands

```
cd src
git clone https://github.com/gwirn/golaf.git
cd golaf/src
go build
mv src golaf
```

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).

To run it use it with `golaf [PATTERN] [FILE]`.
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.

## Usage

Basic search can be done with `golaf [PATTERN] [FILE]`
Basic search can be done with `golaf [PATTERN] [FILE | STDIN]`

The search can also be performed reading from StdIn with e.g. `cat testfile.txt | golaf [PATTERN]`
The search can also be performed reading from StdIn with e.g. `cat [FILE | STDIN] | golaf [PATTERN]`

### Possible optional argument

```
-color string
true to get colored the output - 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
missmatch penalty [NEGATIVE] (default -3)
-quality int
percentage of the pattern that have to macht to be seen as match (default 60)
-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
missmatch penalty [NEGATIVE] (default -3)
-quality int
percentage of the pattern that have to macht to be seen as match (default 75)
```
2 changes: 1 addition & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func argparse() {
// minimum required quality to count as a match
qualityCutOffPtr := flag.Int("quality", 75, "percentage of the pattern that have to macht to be seen as match")
// whether to color the output
colorPtr := flag.String("color", "green", "true to get colored the output - options: [ red green yellow blue purple cyan white ]")
colorPtr := flag.String("color", "green", "color option for highlighting the found results- options: [ red green yellow blue purple cyan white ]")
flag.Parse()
quality := float32(*qualityCutOffPtr) / float32(100)
// number of optional args
Expand Down

0 comments on commit 970b4a4

Please sign in to comment.