aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SimpleHandlers.cpp6
-rw-r--r--src/main.cpp8
2 files changed, 5 insertions, 9 deletions
diff --git a/src/SimpleHandlers.cpp b/src/SimpleHandlers.cpp
index 40cfa68..0ebdd79 100644
--- a/src/SimpleHandlers.cpp
+++ b/src/SimpleHandlers.cpp
@@ -36,14 +36,10 @@ Handler::json Handler::helpHandler(std::string const &arguments, std::string con
for (auto const &itor : *commands) {
std::vector<json> commandAnnotations;
- commandAnnotations.emplace_back(create_annotation(Reply::AnnotationType::command));
+ commandAnnotations.emplace_back(create_annotation(Reply::AnnotationType::command, std::move(*itor.description)));
reply_vec.emplace_back(create_text("- "));
reply_vec.emplace_back(create_text(itor.command, std::move(commandAnnotations)));
- while (!itor.description->empty()) {
- reply_vec.emplace_back(std::move(itor.description->back()));
- itor.description->pop();
- }
}
reply_vec.emplace_back(create_text(
diff --git a/src/main.cpp b/src/main.cpp
index 8e0b442..8289584 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -19,10 +19,10 @@
int main() {
crow::SimpleApp app;
- auto createPlainDescriptionFromText = [](std::string const &text) -> std::queue<crow::json::wvalue> * {
- auto reply_queue = new std::queue<crow::json::wvalue>;
- reply_queue->emplace(Response::create_text(text));
- return reply_queue;
+ auto createPlainDescriptionFromText = [](std::string const &text) -> std::vector<crow::json::wvalue> * {
+ auto reply_vector = new std::vector<crow::json::wvalue>;
+ reply_vector->emplace_back(Response::create_text(text));
+ return reply_vector;
};
// command --> handler