From 970b4a4df25c14687c84649e87102c81af141479 Mon Sep 17 00:00:00 2001 From: gwirn <71886945+gwirn@users.noreply.github.com> Date: Thu, 24 Aug 2023 19:51:37 +0200 Subject: [PATCH] updated README --- .gitignore | 1 + README.md | 33 ++++++++++++++++----------------- src/main.go | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c889f23 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +src/golaf diff --git a/README.md b/README.md index bec9c6c..abebf1f 100644 --- a/README.md +++ b/README.md @@ -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) ``` diff --git a/src/main.go b/src/main.go index aecd9bb..04303a3 100644 --- a/src/main.go +++ b/src/main.go @@ -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