string Parser::getFullOpt(bool keepws, char left, char right) { Arg arg = getFullArg(left, right); if (arg.first) return left + arg.second + right; if (keepws) unskip_spaces(true); return string(); }
string Parser::getFullOpt(bool keepws) { Arg arg = getFullArg('[', ']'); if (arg.first) return '[' + arg.second + ']'; if (keepws) unskip_spaces(true); return string(); }
string Parser::getOpt(bool keepws) { string const res = getArg('[', ']'); if (res.empty()) { if (keepws) unskip_spaces(true); return string(); } return '[' + res + ']'; }