#word-count #word #counter #cli

bin+lib word_counter

A program that displays word count of a file

3 releases (breaking)

0.3.0 Sep 2, 2021
0.2.0 Aug 22, 2021
0.1.0 Aug 21, 2021

#13 in #word-count

26 downloads per month

MIT license

9KB
157 lines

Word Counter

A program that displays word count of a file.

Instllation

Package Managers

Linux

# Cargo
cargo install word_counter

MacOs

# Homebrew
brew tap tasnimAlam/word-counter
brew install tasnimAlam/word-counter/word_counter

Example

Usage

$ ./word_counter poem.txt --top 4 --search lover --max --duration
+---------------+-------+---+
| Search result | lover | 3 |
+---------------+-------+---+
+---------------+-----+---+
| Maximum count | the | 4 |
+---------------+-----+---+
+-------+-------+
| Word  | Count |
+-------+-------+
| the   | 4     |
+-------+-------+
| and   | 3     |
+-------+-------+
| God   | 3     |
+-------+-------+
| lover | 3     |
+-------+-------+
Duration : 2ms 

Options

$ ./word_counter --help
A program that displays word count of a file.

USAGE:
    word_counter [FLAGS] [OPTIONS] <input>

FLAGS:
    -d, --duration    Duration of all the calculations
    -h, --help        Prints help information
    -r, --reverse     Reverse order
    -m, --max         Show most counted word
    -V, --version     Prints version information

OPTIONS:
    -o, --output <output>    Output file
    -s, --search <search>    Search specific word
    -t, --top <top>          Top result limit [default: 10]

ARGS:
    <input>    Input file

Dependencies

~5MB
~79K SLoC