Skip to content

avgra3/cswc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

.NET Word Counter

This is a this is a simple cli tool that essentially works like the wc command on most unix machines.

The tool supports using the pipe operator if there is no filename provided (example below.

Building

If you want to buid and have this tool on your machine, you must have .NET 8.0 sdk installed on your machine. Follow the commands below to install globally on your machine.

# Clone to any directory you want
git clone https://github.com/avgra3/cswc.git

# Or whatever directory you cloned it to
cd cswc

# From the root directory of the project
dotnet pack --nologo -c Release --output ./nupkgs ./src/wc/wc.csproj

# Now time to install globally
dotnet tool install --global --add-source ./nupkgs avgra3.cswc

Example

Usage

cswc --help

# Usage: wc [--bytes] [--words] [--lines] [--chars] [--help] [--version] input
#
# wc
#
# Arguments:
#   0: input    a File or from standard input to be read
#
# Options:
#   -c, --bytes    print the byte counts
#   -w, --words    print the word counts
#   -l, --lines    print the newline counts
#   -m, --chars    print the character counts
#   -h, --help     Show help message
#   --version      Show version

From Standard In

echo "hello world!" | cswc

# Returns:       1       2      12

Inspiration

The inspiration for this project comes from Coding Challenges.

Should This Tool Actually Be Used?

The answer is probably not. the wc command works well enough but if you want your own version that you can hack on, this is a decent start. Feel free to fork it and make your own.

About

A C# implementation of the wc command line tool on Linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages