#includeint main(int argc, char** argv) { arglist::ArgList args(argc, argv); if (args.hasArg("--verbose")) { // do something } return 0; }
#includeIn this example, we are checking whether both the "--verbose" and "--debug" arguments are present in the command-line arguments or not. Package library: The ArgList library is not a part of the C++ standard library but can be found in various third-party libraries and packages such as Boost program_options, CLI11, and docopt.cpp.int main(int argc, char** argv) { arglist::ArgList args(argc, argv); if (args.hasArg("--verbose") && args.hasArg("--debug")) { // do something } return 0; }