Added Documentation

This commit is contained in:
Stephen Toth 2023-09-30 18:14:59 -04:00
parent 1c53c5f054
commit 0ccd2ace10
2 changed files with 13 additions and 11 deletions

View File

@ -23,28 +23,28 @@ sudo apt update; sudo apt install build-essential libreadline-dev make
One-liner to shell for Debain-based distros: One-liner to shell for Debain-based distros:
```sh ```sh
sudo apt update; sudo apt install build-essential libreadline-dev make git && git clone https://git.stephenltoth.com/icaema/colorwrap.git && cd colorwrap && make && make test; sudo apt update; sudo apt install build-essential libreadline-dev make git && git clone https://git.stephenltoth.com/icaema/colorwrap.git && cd colorwrap && make && make run;
``` ```
Run: Run:
```sh ```sh
bin/cterm /bin/sh bin/cterm /bin/sh
# or # or
make test make run
# they do the same thing # they do the same thing
``` ```
## Usage ## Usage
```sh ```sh
make test make run
# or # or
make traces make traces
``` ```
As of right now there are only 7 hardcoded replacements (for color) in the src/main.c file As of right now there are only 7 hardcoded replacements (for color) in the src/main.c file.
Listed here: These are actually regex patterns.
```c ```c
// all are temporary // all are temporary
"^d" //-> Magenta "^d" //-> Magenta
@ -55,7 +55,6 @@ Listed here:
"alpine" //-> Magenta "alpine" //-> Magenta
"z9Da0Da1" //-> Red "z9Da0Da1" //-> Red
``` ```
~~I know its not regex matching yet, just go with it~~
In the testing directory, there are some test files for doing `ls -al` and a `long` file for being long (with some keywords being sprinkled in). In the testing directory, there are some test files for doing `ls -al` and a `long` file for being long (with some keywords being sprinkled in).
@ -71,10 +70,11 @@ If you need to use these kinds of applications, do not use this program to wrap
## Installation ## Installation
Normal Build: `make` Normal build: `make`
Debug Build: `make debug` Debug build: `make debug`
Run unit tests: `make test`
## Example ## Example
@ -88,11 +88,13 @@ Location of Documentation
|-- Makefile <- Project makefile |-- Makefile <- Project makefile
|-- README <- Project README |-- README <- Project README
|-- bin <- Compiled binaries |-- bin <- Compiled binaries
| `-- run <- Project main executable | |-- cterm <- Project main executable
| `-- testsuite <- Unit testing executable
|-- build <- Static objects and intermediate files |-- build <- Static objects and intermediate files
|-- docs <- Documentation |-- docs <- Documentation
|-- include <- Header files |-- include <- Header files
|-- lib <- Dynamic objects |-- lib <- Dynamic objects
|-- src <- Source files |-- src <- Source files
`-- tests <- Unit tests |-- tests <- Unit tests
`-- testing <- Various dynamic testing files
``` ```

View File

@ -22,7 +22,7 @@ void printbranding(){
sprintf(pre_print_lines[0], "%s v%d.%d.%d" , PROJECT_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); sprintf(pre_print_lines[0], "%s v%d.%d.%d" , PROJECT_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD);
//sprintf(pre_print_lines[0], "%s v%d.%d.%d.%d" , PROJECT_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_HOTFIX, VERSION_BUILD); //sprintf(pre_print_lines[0], "%s v%d.%d.%d.%d" , PROJECT_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_HOTFIX, VERSION_BUILD);
sprintf(pre_print_lines[1], "(c) never"); sprintf(pre_print_lines[1], "(c) never");
sprintf(pre_print_lines[2], "%d rules loaded", 9); //TODO: actually use the number of rules loaded sprintf(pre_print_lines[2], "%d rules loaded", 7); //TODO: actually use the number of rules loaded
if (GITBRANCH) sprintf(pre_print_lines[3], "%s", GITBRANCH); if (GITBRANCH) sprintf(pre_print_lines[3], "%s", GITBRANCH);