From 1785bdd9c01888e3bbcac1774867db9a50e900a7 Mon Sep 17 00:00:00 2001 From: Nicolo P Date: Tue, 15 Feb 2022 20:31:42 +0100 Subject: [PATCH] More changes to README --- README.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8ce985a..6817c37 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ The command synopsis is very similar to `grep`, although it needs the Python int python crapgrep.py [OPTIONS] [PATTERN] [FILE[...]] ``` +_**Note**: obviously, `crapgrep` doesn't read from `stdin`, which makes it even more useless..._ + ## Examples The examples below assume that `python` is an alias of `python3`. @@ -35,13 +37,12 @@ python crapgrep.py -i hOlA garbage.txt ### Regexp -**Note**: unlike `grep`, `crapgrep` doesn't treat the string as a regular expression pattern by default, it must be specified by passing the `-E` option expliclty. +_**Note**: unlike `grep`, `crapgrep` doesn't treat the string as a regular expression pattern by default, it must be specified by passing the `-E` option explicitly._ Searching for pattern `'^urka[0-9]'` in files `garbage1.txt` and `garbage2.txt` in the parent directory: ``` python crapgrep.py -E '^urka[0-9]' ../garbage1.txt ../garbage2.txt - ``` When multiple files are passed, `crapgrep` will prepend the file name to the matched lines printed to `stdout`. @@ -49,8 +50,8 @@ When multiple files are passed, `crapgrep` will prepend the file name to the mat Considering the example above, the output could be something like: ``` -garbage1.txt:urka2 paletta -garbage2.txt:urka4l8 +../garbage1.txt:urka2 paletta +../garbage2.txt:urka4l8 ``` ### Line numbers @@ -64,12 +65,22 @@ python crapgrep.py -E -n '^urka[0-9]' ../garbage1.txt ../garbage2.txt could output something like: ``` -garbage1.txt:5:urka2 paletta -garbage2.txt:73:urka4l8 +../garbage1.txt:5:urka2 paletta +../garbage2.txt:73:urka4l8 ``` meaning that the matches were found in lines `5` and `73` of `garbage1.txt` and `garbage2.txt`, respectively. -## Text coverage +## Test coverage Ehm... + +## Why + +If you're asking yourself: "_Why would you inflict something like this upon the world?_", the answer is... because it's fun! + +## TODO + +- [ ] Implement the recursive search option (`-r`) +- [ ] Implement long options (e.g.,`--ignore-case`) +- [ ] Abandon the project!!