Skip to content

SaabriinMo/wc_tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

wc_tool

This is my attempt to build my own unix command line wc

Here's the task:

https://codingchallenges.fyi/challenges/challenge-wc

Description

wc tool runs different statistics on a file such as word count, byte count, char count and etc.

Usage

if unsure on how to run the function

usage: ccwc.py [-h] [-c] [-l] [-w] [-m] [file]

wc tool

positional arguments:
  file

optional arguments:
  -h, --help  show this help message and exit
  -c          gets the byte count
  -l          outputs number of lines in file
  -w          outputs number of words in files
  -m          outputs number of characters in files

Examples

python3 ccwc.py -l test.txt
cat test.txt | ccwc.py -l

unit testing

Unit testing were used to test the different functions to make sure each values return the correct values. These can be found in

wc_tool.py

To run the file, run this in the terminal:

python -m unittest test_wc_tool.py

Next steps:

add setup.py so that i wouldn't need to explicitly use python / python3 to receive the output.

About

wc tool- coding challenges

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages