From af1e49933fe5f40d89aa1813e2a0f677874b607c Mon Sep 17 00:00:00 2001 From: Jamason Davis Date: Wed, 7 Feb 2024 19:02:28 -0600 Subject: [PATCH] Update README.md --- README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9970482..9119c1d 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,36 @@ A basic library providing an extensible CLI interface written in C++. This library is meant to help with alot of argument boilerplating. Speeding up workflows of developing primarily CLI based applications. ## Usage: -*WIP* +Example program: +```cpp +#include +#include + +using namespace opencxx_cli; + +int testFunc() { + std::cout << "Hello World!\n"; + return 0; +} + +int main(int argc, char *argv[]) { + opencxx_cli::CLI cli; + + std::vector entries; + cli.addEntry("--test", "-t", testFunc, &entries); + cli.parse(entries, cli.vectorize(argc, argv)); + + return 0; +} +``` + +More information can be found in the wiki. But the general idea is to create a vector to store entries, add entries, then run `cli.parse()` to let it handle the rest. ## Planned Features: - [x] Basic Color Manipulation. - [ ] Automated argument handling. - [ ] Populate `--help` with new argument checks. - - [ ] Iterate over vector of arguments + - [x] Iterate over vector of arguments - [ ] Call respective functions that were declared earlier in code. - [ ] Flavortext and colorizing of default commands.