diff irccdctl/plugin_info_cli.cpp @ 662:e9153b85b9bd

Tests: test irccdctl (plugin-* commands) #785 While here, fix many commands that were throwing invalid_message because of missing 'command' JSON property.
author David Demelier <markand@malikania.fr>
date Thu, 29 Mar 2018 09:13:51 +0200
parents 4a13a016ea4f
children db9acd7993cd
line wrap: on
line diff
--- a/irccdctl/plugin_info_cli.cpp	Wed Mar 28 07:59:03 2018 +0200
+++ b/irccdctl/plugin_info_cli.cpp	Thu Mar 29 09:13:51 2018 +0200
@@ -34,7 +34,12 @@
     if (args.size() < 1)
         throw std::invalid_argument("plugin-info requires 1 argument");
 
-    request(ctl, {{ "plugin", args[0] }}, [] (auto result) {
+    const auto json = nlohmann::json::object({
+        { "command",    "plugin-info"   },
+        { "plugin",     args[0]         }
+    });
+
+    request(ctl, json, [] (auto result) {
         const json_util::parser parser(result);
 
         std::cout << std::boolalpha;