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
split_program_name
auto commandLine="\"C:\\example.exe\"" try { app.parse(commandLine, true); } catch (const CLI::ParseError& e) { //return app.exit(e); }
split_program_name will throw std::out_of_range exception, if nothing left in command line after removing the program name here:
std::out_of_range
vals.second = (esp != std::string::npos) ? commandline.substr(esp + 1) : std::string{};
a quick fix is:
trim(commandline); auto length = commandline.length(); auto esp = commandline.find_first_of(' ', 1); while(detail::check_path(commandline.substr(0, esp).c_str()) != path_type::file){ ...... // strip the program name vals.second = (esp != std::string::npos) && (esp < length) ? commandline.substr(esp + 1) : std::string{};
The text was updated successfully, but these errors were encountered:
Thanks for catching this, the fix has been merged into main
Sorry, something went wrong.
No branches or pull requests
split_program_name
will throwstd::out_of_range
exception, if nothing left in command line after removing the program name here:vals.second = (esp != std::string::npos) ? commandline.substr(esp + 1) : std::string{};
a quick fix is:
The text was updated successfully, but these errors were encountered: