Crates.io | perg |
lib.rs | perg |
version | 0.5.1 |
source | src |
created_at | 2019-04-18 17:40:46.429281 |
updated_at | 2020-04-28 13:06:40.847891 |
description | perg is a small command-line tool to search for given string inside a file |
homepage | https://github.com/vinhnx/perg |
repository | https://github.com/vinhnx/perg |
max_upload_size | |
id | 128700 |
size | 8,437 |
A micro lightweight implementation of grep
, written in Rust.
It's mainly for my journey to learn Rust programming language and its fascinated ecosystem, but feel free to use it. :smile:
❯ perg --help
perg x.x.x
Vinh Nguyen <>
perg is a small command-line tool to search for given string inside a file
USAGE:
perg [FLAGS] <PATTERN> <FILE>
FLAGS:
-h, --help Prints help information
-i, --ignore-case Perform case insensitive matching. Default is case sensitive.
-V, --version Prints version information
ARGS:
<PATTERN> pattern to search, can use regular expression
<FILE> path to file
a test.md
is included in this repo:
$ cat test.md
hello world hi world bye world end of file Title
to try out perg
on the included test.md
file:
$ perg h test.md
# hello world
# hi world
perg
also support regular expression search, like grep
:
$ perg "h[ei]" test.md
# hello world
# hi world
$ perg "hello|bye" test.md
# hello world
# bye world
$ perg "^(be)" test.md
# bye world
# end of file
case insensitive search:
$ perg -i I test.md
# hi world
# end of file
Using Cargo via rustup
:
$ curl https://sh.rustup.rs -sSf | sh
then install perg
binary:
$ cargo install perg
As of now, Rust is one the most favorited programming according to StackOverflow. :gift:
Feel free to contact me on Twitter for discussions, news & announcements & other projects. :rocket:
Glad you asked, perg
is just the reversed of grep
.