Build the GO program first.
go build -o ./wc ./cmd/main.go
Execute:
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt test2.txt
2 5 12 test.txt
6 8 18 test2222.txt
8 13 30 total
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt
2 5 12 test.txt
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc -h
USAGE: wc [OPTIONS] FILE(S)
-c print the byte counts
-l print the newline counts
-w print the word counts
EXAMPLE:
wc -l logs.txt
wc -w logs.txt
wc -l logs.txt logs2.txt
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt test2.txt test.txt -l -w
2 5 test.txt
6 8 test2.txt
2 5 test.txt
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc -h
USAGE: wc [OPTIONS] FILE(S)
-c print the byte counts
-l print the newline counts
-w print the word counts
EXAMPLE:
wc -l logs.txt
wc -w logs.txt
wc -l logs.txt logs2.txt
abhisekhs@abhisekhs-ThinkPad-L490:~/personal/Projects/wc-tool$ ./wc test.txt test2.txt test.txt -l -w
2 5 test.txt
6 8 test2.txt
2 5 test.txt