diff --git a/cmdopt2/parser.cpp b/cmdopt2/parser.cpp index 001afd58..b9387d7c 100644 --- a/cmdopt2/parser.cpp +++ b/cmdopt2/parser.cpp @@ -2,6 +2,8 @@ #include "./args.hpp" +#include + using cruft::cmdopt2::parser; @@ -163,6 +165,12 @@ parser::parse (int const argc, const char *const *argv) if (argc <= 1) return argc; + using namespace std::string_view_literals; + if (contains ("--help"sv, cruft::view (argv, argc))) { + usage (argc, argv, stdout); + exit (EXIT_SUCCESS); + } + int arg_cursor = 1; int pos_cursor = 0;