Skip to content

Commit

Permalink
Update the examples' README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dr8co committed Apr 13, 2024
1 parent 3eb9395 commit 64e6967
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The text file should not be bigger than 1MB.
```bash
# Compile and link the example
gcc -o word_stats word_stats.c /path/to/liblite-string.a -std=c2x

# Run the example
./word_stats blindtext.txt
```
Expand All @@ -26,8 +27,10 @@ gcc -o word_stats word_stats.c /path/to/liblite-string.a -std=c2x
```bash
# Compile and link the example
g++ -o cheap_grep cheap_grep.cpp /path/to/liblite-string.a -std=c++20

# Run the example
./cheap_grep -i "ipsum dolor" blindtext.txt

# The program can also read from standard input, when the file name is replaced with a hyphen
cat blindtext.txt | ./cheap_grep -i "ipsum dolor" -
./cheap_grep -i "lorem ipsum dolor sit amet consectetur adipiscing" - < blindtext.txt
Expand All @@ -51,3 +54,9 @@ The examples can be found in the `build` directory.
./build/word_stats blindtext.txt
./build/cheap_grep -i "ipsum dolor" blindtext.txt
```

For more elaborate examples, refer to the [tests'](../tests) directory.

You can also check [Cachetron](https://github.com/dr8co/Cachetron), a simple cache server,
which uses an earlier version of LiteString for parsing the commands
and for other string manipulations.

0 comments on commit 64e6967

Please sign in to comment.