cli-fancy/README.md

27 lines
602 B
Markdown
Raw Permalink Normal View History

2024-12-15 19:53:40 +01:00
# cli-fancy library
Single header library for cli apps
2024-12-15 19:59:40 +01:00
Used in ctrff and npi-build
## Example
```cpp
#include <cli-fancy.hpp>
void ShowString(const cf7::command::ArgumentList& data) {
2024-12-16 22:13:20 +01:00
std::cout << "Input String was: " << cf7::command::GetArg(data, "input") << std::endl;
2024-12-15 19:59:40 +01:00
}
int main(int argc, char* argv[]) {
cf7::arg_mgr mgr(argc, argv);
mgr.SetAppInfo("test", "1.0.0");
mgr.AddCommand(
cf7::command("show", "Show an input String")
.AddSubEntry(cf7::command::sub("i", "input", "Input String", true))
.SetFunction(ShowString));
mgr.Execute();
return 0;
}
```