Change command-line parsing (again...)

- Added formatted table with `--style` option
- Added `warning` log level
- Fixed bugs and cleaned up API
- Removed some extra debugging output
This commit is contained in:
David Allen 2023-07-01 21:32:24 -06:00
parent 0238dfd510
commit b36d55ceee
15 changed files with 685 additions and 255 deletions

View file

@ -13,6 +13,8 @@ namespace gdpm::constants::error{
NONE = 0,
UNKNOWN,
UNKNOWN_COMMAND,
UNKNOWN_ARGUMENT,
ARGPARSE_ERROR,
NOT_FOUND,
NOT_DEFINED,
NOT_IMPLEMENTED,
@ -102,6 +104,11 @@ namespace gdpm{
#endif
}
static constexpr gdpm::error error_rc(const gdpm::error& e){
error(e);
return e;
}
static void error(const char *p, const gdpm::error& e){
println("{}{}{}", p, prefix.contents, e.get_message());
}