int count, coeff;
bool triple = false;
argvx::parser<> parser(argc, argv);
parser.positional("count", count).required();
parser.option({"--coefficient", "-co"}, coeff).required();
parser.option({"--triple"}, triple);
if (auto error = parser.parse())
...Warning
This project is still in its early stages. The foundation is solid, but more features are planned.
There are other great parsers for C++ out there- but all of them had cons that were deal-breakers for me; annoying licenses, lack of QoL/utilities, bad ergonomics, exception-oriented design, etc... So I decided to make my own and publicize it, in the hopes that someone may find it useful. It does not aim to replace anyone or anything.
Just clone the repository and add {root}/include to your include directories.
- 🟨 Core
- 🟩 Positional arguments
- 🟥 Subcommands
- 🟩 Long & short options
- 🟩 Basic values (bool, int, uint, float, string, path)
- 🟥 Extra
- 🟥 Packed options (e.g.
-abc <value>instead of-a -b -c <value>) - 🟥 Comma-seperated values (e.g.
-opt a,b,c) - 🟥 IO values (e.g.
--for stdout)
- 🟥 Packed options (e.g.
- 🟨 Ergonomics
- 🟩 Typed value binding
- 🟥 Validators/policies
- 🟥 Auto-generated help command
Legend
- 🟩 = Completed - 🟨 = In progress - 🟥 = PlannedThis project was initially a part of via-lang, but was forked off because I felt like it.