We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Program crashes when calling programArgs.parse_args(argc, argv); :
programArgs.parse_args(argc, argv);
// Print help message friend auto operator<<(std::ostream &stream, const ArgumentParser &parser) -> std::ostream & { stream.setf(std::ios_base::left); stream << "Usage: " << parser.m_parser_path << " [options] "; for (const auto &argument : parser.m_positional_arguments) { stream << argument.m_names.front() << " "; // Crashes here }
0x00007ff6f1872590 L"\"front() called on empty vector\""
void argsHandling(int argc, char** argv) { programArgs = argparse::ArgumentParser("program.exe"); programArgs.add_description("bla bla bla lba"); programArgs.add_epilog("bla bla bla sdasdsdasdas"); programArgs.add_argument("--verbose") .help("increase output verbosity") .default_value(false) .implicit_value(true); programArgs.add_argument("--json-print") .help("print a JSON structure") .default_value(false) .implicit_value(true); programArgs.add_argument("--json-file") .help("create a JSON file") .default_value(std::string{ "file.json" }); programArgs.add_argument("--something-path") .help("tell program for a path"); try { programArgs.parse_args(argc, argv); } catch (const std::runtime_error& err) { std::cerr << err.what() << std::endl; std::cerr << programArgs; std::exit(1); } }
The text was updated successfully, but these errors were encountered:
Appears to be fixed by #292
Sorry, something went wrong.
No branches or pull requests
Program crashes when calling
programArgs.parse_args(argc, argv);
:0x00007ff6f1872590 L"\"front() called on empty vector\""
The text was updated successfully, but these errors were encountered: