This is a simple version of the wc
tool implemented in Rust. It counts the number of lines, words, and characters in a given file.
To use the rust_wc
tool, follow these steps:
-
Clone the repository:
git clone https://github.com/adarsh0raj/rust_wc.git
-
Build the project:
cd rust_wc cargo build
-
Run the executable:
./target/debug/rust_wc <flag> <file_path>
Replace
<file_path>
and<flag>
with the path to the file you want to count and the flag.
Here's an example of how to use the rust_wc
tool:
./target/debug/rust_wc -l ./Cargo.toml
Available flags:
-c
or--bytes
: print the byte counts-l
or--lines
: print the newline counts-w
or--words
: print the word counts-m
or--characters
: print the character counts-h
or--help
: display help and exit