An implementation of the UNIX tool `wc` in Rust.
Go to file
Christian Nicola 70667bfdc7
chore: add .gitignore & README
2023-11-21 16:33:43 +01:00
src feat: wc implementation in rust 2023-11-21 16:27:17 +01:00
.gitignore chore: add .gitignore & README 2023-11-21 16:33:43 +01:00
Cargo.lock feat: wc implementation in rust 2023-11-21 16:27:17 +01:00
Cargo.toml feat: wc implementation in rust 2023-11-21 16:27:17 +01:00
README.md chore: add .gitignore & README 2023-11-21 16:33:43 +01:00

README.md

wc-res

I wanted to build something useful in Rust, so I built a version of wc. It supports the following queries:

  • -m: Print the amount of characters in a file.
  • -c: Prints the number of bytes the file is comprised of.
  • -l: Prints the number of lines the file has
  • -w: Prints the number of words

If no query is provided, it displays the number of bytes, number of lines and finally the number of words, in that order.

This is how it can be used:

  • wc-rs <query> <file>
  • wc-rs <file>

It also supports pipes:

  • cat <file> | wc-rs <query>
  • cat <file> | wc-rs