Simplify output line construction
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <sstream>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <libscrequest.hpp>
|
#include <libscrequest.hpp>
|
||||||
@@ -65,9 +64,8 @@ int main(int argc, char* argv[]) {
|
|||||||
std::vector<std::string> lines;
|
std::vector<std::string> lines;
|
||||||
for (std::sregex_iterator i = beg; i != end; ++i) {
|
for (std::sregex_iterator i = beg; i != end; ++i) {
|
||||||
std::smatch match {*i};
|
std::smatch match {*i};
|
||||||
std::ostringstream oss;
|
std::string line = std::string(match[1]) + " [" + std::string(match[2]) + "]\n";
|
||||||
oss << match[1] << " [" << match[2] << "]\n";
|
lines.insert(lines.begin(), line);
|
||||||
lines.insert(lines.begin(), oss.str());
|
|
||||||
if (!all) break;
|
if (!all) break;
|
||||||
}
|
}
|
||||||
for (const std::string& line : lines) {
|
for (const std::string& line : lines) {
|
||||||
|
Reference in New Issue
Block a user