Skip to content

crash with one dash #123

@PaltryProgrammer

Description

@PaltryProgrammer

please see attached GIF demonstrate crash with one dash i.e. to wit if an option is introduced w/ one dash instead of two exception is thrown . below is code executed .

#include <boost\program_options.hpp>
#include <map>
#include <string>
using namespace std;

const string option_flag = "O";
const string option_flag_description = string("an option");

const map<string , string> options__description_map = {
	{option_flag, option_flag_description},
};

int main(int argc, const char* argv[], const char* envp[])
{
	boost::program_options::variables_map vm;
	string macros;
	boost::program_options::options_description options_description("bugyCode options");
	options_description.add_options()
		(option_flag.c_str(), boost::program_options::value<string>(&macros), option_flag_description.c_str());

	boost::program_options::store(boost::program_options::parse_command_line(argc, argv, options_description), vm);
	boost::program_options::notify(vm);
	return 0;
}

crash with one dash demonstration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions