https://github.com/freaky/cw
A Rust wc clone
https://github.com/freaky/cw
Last synced: about 1 year ago
JSON representation
A Rust wc clone
- Host: GitHub
- URL: https://github.com/freaky/cw
- Owner: Freaky
- License: mit
- Created: 2019-01-07T00:02:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-10-06T03:39:48.000Z (over 3 years ago)
- Last Synced: 2025-03-24T09:19:56.994Z (about 1 year ago)
- Language: Rust
- Size: 66.4 KB
- Stars: 103
- Watchers: 5
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# cw - Count Words
A fast `wc` clone in Rust.
## Synopsis
```
-% cw --help
cw 0.5.0
Thomas Hurst
Count Words - word, line, character and byte count
USAGE:
cw [FLAGS] [OPTIONS] [input]...
FLAGS:
-c, --bytes Count bytes
-m, --chars Count UTF-8 characters instead of bytes
-h, --help Prints help information
-l, --lines Count lines
-L, --max-line-length Count bytes (default) or characters (-m) of the longest line
-V, --version Prints version information
-w, --words Count words
OPTIONS:
--files0-from Read input from the NUL-terminated list of filenames in the given file.
--files-from Read input from the newline-terminated list of filenames in the given file.
--threads Number of counting threads to spawn [default: 1]
ARGS:
... Input files
-% cw Dickens_Charles_Pickwick_Papers.xml
3449440 51715840 341152640 Dickens_Charles_Pickwick_Papers.xml
```
## Performance
Counts of multiple files may be accelerated by use of the `--threads` option:
```
'xargs