This cli folder contains command-line utilities that offer functionality similar to common Unix tools but with custom implementations. Currently, it includes two projects: fc and cdiff.
A command-line utility similar to wc, designed to count files by their extensions given a directory path. It lists the counts of all varying extensions in a neat tabular format.
Run the program with the directory path as an argument:
./build/fc.out <directory_path>A simplified, custom implementation of the 'diff' command-line tool. It supports three modes:
- Default Mode: Highlights differences between files line-by-line. This mode applies if no specific mode is provided as arguments.
- Context Mode: Displays lines around the differing sections, similar to 'diff -c'.
- Unified Mode: Shows differing lines with a few surrounding lines, similar to 'diff -u'.
Run the program by specifying the comparison mode and paths to two files:
./build/cdiff.out [-u | -c] <file1> <file2>- Use '-u' for unified mode.
- Use '-c' for context mode.
To build the project, use the provided Makefile. It will create both debug and release versions of the executables.
- build-debug: Compiles the source files into debug executables located in the
builddirectory. - build-release: Compiles the source files into release executables located in the
builddirectory. - clean: Removes the compiled executables from the
builddirectory.
You can use the following commands in your terminal:
make build-debug # For debug builds
make build-release # For release builds
make clean # To clean up build files