# HG changeset patch # User David Demelier # Date 1465473055 -7200 # Node ID c26754e419c499c01f076addc330ed799b3b91e9 # Parent 786559f1937f7db5a27cbbc5d86ffe4019e1ee08 Irccd: rename RemoteCommand to Command diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-help.cpp --- a/lib/irccd/cmd-help.cpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-help.cpp Thu Jun 09 13:50:55 2016 +0200 @@ -25,11 +25,11 @@ namespace command { Help::Help() - : RemoteCommand("help", "General") + : Command("help", "General") { } -std::vector Help::args() const +std::vector Help::args() const { return {{ "command", true }}; } @@ -39,7 +39,7 @@ return "Get help about a command."; } -json::Value Help::request(Irccdctl &irccdctl, const RemoteCommandRequest &args) const +json::Value Help::request(Irccdctl &irccdctl, const CommandRequest &args) const { auto it = irccdctl.commandService().find(args.arg(0U)); diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-help.hpp --- a/lib/irccd/cmd-help.hpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-help.hpp Thu Jun 09 13:50:55 2016 +0200 @@ -34,7 +34,7 @@ * \class Help * \brief Implementation of irccdctl help. */ -class Help : public RemoteCommand { +class Help : public Command { public: /** * Constructor. @@ -42,19 +42,19 @@ IRCCD_EXPORT Help(); /** - * \copydoc RemoteCommand::args + * \copydoc Command::args */ IRCCD_EXPORT std::vector args() const override; /** - * \copydoc RemoteCommand::help + * \copydoc Command::help */ IRCCD_EXPORT std::string help() const override; /** - * \copydoc RemoteCommand::request + * \copydoc Command::request */ - IRCCD_EXPORT json::Value request(Irccdctl &irccdctl, const RemoteCommandRequest &args) const override; + IRCCD_EXPORT json::Value request(Irccdctl &irccdctl, const CommandRequest &args) const override; }; } // !command diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-config.cpp --- a/lib/irccd/cmd-plugin-config.cpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-config.cpp Thu Jun 09 13:50:55 2016 +0200 @@ -60,7 +60,7 @@ } // !namespace PluginConfig::PluginConfig() - : RemoteCommand("plugin-config", "Plugins") + : Command("plugin-config", "Plugins") { } @@ -69,7 +69,7 @@ return "Get or set a plugin configuration option."; } -std::vector PluginConfig::args() const +std::vector PluginConfig::args() const { return { { "plugin", true }, @@ -78,7 +78,7 @@ }; } -json::Value PluginConfig::request(Irccdctl &, const RemoteCommandRequest &args) const +json::Value PluginConfig::request(Irccdctl &, const CommandRequest &args) const { auto object = json::object({ { "plugin", args.arg(0) } @@ -101,7 +101,7 @@ void PluginConfig::result(Irccdctl &irccdctl, const json::Value &response) const { - RemoteCommand::result(irccdctl, response); + Command::result(irccdctl, response); auto it = response.find("vars"); diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-config.hpp --- a/lib/irccd/cmd-plugin-config.hpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-config.hpp Thu Jun 09 13:50:55 2016 +0200 @@ -33,7 +33,7 @@ /** * \brief Implementation of plugin-config transport command. */ -class PluginConfig : public RemoteCommand { +class PluginConfig : public Command { public: /** * Constructor. @@ -41,27 +41,27 @@ IRCCD_EXPORT PluginConfig(); /** - * \copydoc RemoteCommand::help + * \copydoc Command::help */ IRCCD_EXPORT std::string help() const override; /** - * \copydoc RemoteCommand::args + * \copydoc Command::args */ IRCCD_EXPORT std::vector args() const override; /** - * \copydoc RemoteCommand::request + * \copydoc Command::request */ - IRCCD_EXPORT json::Value request(Irccdctl &irccdctl, const RemoteCommandRequest &args) const override; + IRCCD_EXPORT json::Value request(Irccdctl &irccdctl, const CommandRequest &args) const override; /** - * \copydoc RemoteCommand::exec + * \copydoc Command::exec */ IRCCD_EXPORT json::Value exec(Irccd &irccd, const json::Value &request) const override; /** - * \copydoc RemoteCommand::result + * \copydoc Command::result */ IRCCD_EXPORT void result(Irccdctl &irccdctl, const json::Value &response) const override; }; diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-info.cpp --- a/lib/irccd/cmd-plugin-info.cpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-info.cpp Thu Jun 09 13:50:55 2016 +0200 @@ -29,7 +29,7 @@ namespace command { PluginInfo::PluginInfo() - : RemoteCommand("plugin-info", "Plugins") + : Command("plugin-info", "Plugins") { } @@ -38,12 +38,12 @@ return "Get plugin information."; } -std::vector PluginInfo::args() const +std::vector PluginInfo::args() const { return {{ "plugin", true }}; } -json::Value PluginInfo::request(Irccdctl &, const RemoteCommandRequest &args) const +json::Value PluginInfo::request(Irccdctl &, const CommandRequest &args) const { return json::object({{ "plugin", args.arg(0) }}); } @@ -62,7 +62,7 @@ void PluginInfo::result(Irccdctl &irccdctl, const json::Value &result) const { - RemoteCommand::result(irccdctl, result); + Command::result(irccdctl, result); // Plugin information. if (result.valueOr("status", false).toBool()) { diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-info.hpp --- a/lib/irccd/cmd-plugin-info.hpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-info.hpp Thu Jun 09 13:50:55 2016 +0200 @@ -34,7 +34,7 @@ * \class PluginInfo * \brief Implementation of plugin-info transport command. */ -class PluginInfo : public RemoteCommand { +class PluginInfo : public Command { public: /** * Constructor. @@ -42,27 +42,27 @@ IRCCD_EXPORT PluginInfo(); /** - * \copydoc RemoteCommand::help + * \copydoc Command::help */ IRCCD_EXPORT std::string help() const override; /** - * \copydoc RemoteCommand::args + * \copydoc Command::args */ IRCCD_EXPORT std::vector args() const override; /** - * \copydoc RemoteCommand::request + * \copydoc Command::request */ - IRCCD_EXPORT json::Value request(Irccdctl &irccdctl, const RemoteCommandRequest &args) const override; + IRCCD_EXPORT json::Value request(Irccdctl &irccdctl, const CommandRequest &args) const override; /** - * \copydoc RemoteCommand::exec + * \copydoc Command::exec */ IRCCD_EXPORT json::Value exec(Irccd &irccd, const json::Value &request) const override; /** - * \copydoc RemoteCommand::result + * \copydoc Command::result */ IRCCD_EXPORT void result(Irccdctl &irccdctl, const json::Value &response) const override; }; diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-list.cpp --- a/lib/irccd/cmd-plugin-list.cpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-list.cpp Thu Jun 09 13:50:55 2016 +0200 @@ -29,7 +29,7 @@ namespace command { PluginList::PluginList() - : RemoteCommand("plugin-list", "Plugins") + : Command("plugin-list", "Plugins") { } @@ -40,7 +40,7 @@ json::Value PluginList::exec(Irccd &irccd, const json::Value &request) const { - json::Value response = RemoteCommand::exec(irccd, request); + json::Value response = Command::exec(irccd, request); json::Value list = json::array({}); for (const auto &plugin : irccd.pluginService().plugins()) @@ -53,7 +53,7 @@ void PluginList::result(Irccdctl &irccdctl, const json::Value &object) const { - RemoteCommand::result(irccdctl, object); + Command::result(irccdctl, object); for (const auto &n : object.valueOr("list", json::Type::Array, json::array({}))) std::cout << n.toString() << std::endl; diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-list.hpp --- a/lib/irccd/cmd-plugin-list.hpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-list.hpp Thu Jun 09 13:50:55 2016 +0200 @@ -34,7 +34,7 @@ * \class PluginList * \brief Implementation of plugin-list transport command. */ -class PluginList : public RemoteCommand { +class PluginList : public Command { public: /** * Constructor. @@ -42,17 +42,17 @@ IRCCD_EXPORT PluginList(); /** - * \copydoc RemoteCommand::help + * \copydoc Command::help */ IRCCD_EXPORT std::string help() const override; /** - * \copydoc RemoteCommand::exec + * \copydoc Command::exec */ IRCCD_EXPORT json::Value exec(Irccd &irccd, const json::Value &request) const override; /** - * \copydoc RemoteCommand::result + * \copydoc Command::result */ IRCCD_EXPORT void result(Irccdctl &irccdctl, const json::Value &response) const override; }; diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-load.cpp --- a/lib/irccd/cmd-plugin-load.cpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-load.cpp Thu Jun 09 13:50:55 2016 +0200 @@ -26,7 +26,7 @@ namespace command { PluginLoad::PluginLoad() - : RemoteCommand("plugin-load", "Plugins") + : Command("plugin-load", "Plugins") { } @@ -35,7 +35,7 @@ return "Load a plugin."; } -std::vector PluginLoad::args() const +std::vector PluginLoad::args() const { return {{ "plugin", true }}; } @@ -46,7 +46,7 @@ irccd.pluginService().load(name); - return RemoteCommand::exec(irccd, request); + return Command::exec(irccd, request); } } // !command diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-load.hpp --- a/lib/irccd/cmd-plugin-load.hpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-load.hpp Thu Jun 09 13:50:55 2016 +0200 @@ -34,7 +34,7 @@ * \class PluginLoad * \brief Implementation of plugin-load transport command. */ -class PluginLoad : public RemoteCommand { +class PluginLoad : public Command { public: /** * Constructor. @@ -42,17 +42,17 @@ IRCCD_EXPORT PluginLoad(); /** - * \copydoc RemoteCommand::help + * \copydoc Command::help */ IRCCD_EXPORT std::string help() const override; /** - * \copydoc RemoteCommand::args + * \copydoc Command::args */ IRCCD_EXPORT std::vector args() const override; /** - * \copydoc RemoteCommand::exec + * \copydoc Command::exec */ IRCCD_EXPORT json::Value exec(Irccd &irccd, const json::Value &request) const override; }; diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-reload.cpp --- a/lib/irccd/cmd-plugin-reload.cpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-reload.cpp Thu Jun 09 13:50:55 2016 +0200 @@ -27,7 +27,7 @@ namespace command { PluginReload::PluginReload() - : RemoteCommand("plugin-reload", "Plugins") + : Command("plugin-reload", "Plugins") { } @@ -36,7 +36,7 @@ return "Reload a plugin."; } -std::vector PluginReload::args() const +std::vector PluginReload::args() const { return {{ "plugin", true }}; } @@ -45,7 +45,7 @@ { irccd.pluginService().require(request.at("plugin").toString())->onReload(irccd); - return RemoteCommand::exec(irccd, request); + return Command::exec(irccd, request); } } // !command diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-reload.hpp --- a/lib/irccd/cmd-plugin-reload.hpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-reload.hpp Thu Jun 09 13:50:55 2016 +0200 @@ -34,7 +34,7 @@ * \class PluginReload * \brief Implementation of plugin-reload transport command. */ -class PluginReload : public RemoteCommand { +class PluginReload : public Command { public: /** * Constructor. @@ -42,17 +42,17 @@ IRCCD_EXPORT PluginReload(); /** - * \copydoc RemoteCommand::help + * \copydoc Command::help */ IRCCD_EXPORT std::string help() const override; /** - * \copydoc RemoteCommand::args + * \copydoc Command::args */ IRCCD_EXPORT std::vector args() const override; /** - * \copydoc RemoteCommand::exec + * \copydoc Command::exec */ IRCCD_EXPORT json::Value exec(Irccd &irccd, const json::Value &request) const override; }; diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-unload.cpp --- a/lib/irccd/cmd-plugin-unload.cpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-unload.cpp Thu Jun 09 13:50:55 2016 +0200 @@ -26,7 +26,7 @@ namespace command { PluginUnload::PluginUnload() - : RemoteCommand("plugin-unload", "Plugins") + : Command("plugin-unload", "Plugins") { } @@ -35,7 +35,7 @@ return "Unload a plugin."; } -std::vector PluginUnload::args() const +std::vector PluginUnload::args() const { return {{ "plugin", true }}; } @@ -44,7 +44,7 @@ { irccd.pluginService().unload(request.at("plugin").toString()); - return RemoteCommand::exec(irccd, request); + return Command::exec(irccd, request); } } // !command diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-plugin-unload.hpp --- a/lib/irccd/cmd-plugin-unload.hpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-plugin-unload.hpp Thu Jun 09 13:50:55 2016 +0200 @@ -34,7 +34,7 @@ * \class PluginUnload * \brief Implementation of plugin-unload transport command. */ -class PluginUnload : public RemoteCommand { +class PluginUnload : public Command { public: /** * Constructor. @@ -42,17 +42,17 @@ IRCCD_EXPORT PluginUnload(); /** - * \copydoc RemoteCommand::help + * \copydoc Command::help */ IRCCD_EXPORT std::string help() const override; /** - * \copydoc RemoteCommand::args + * \copydoc Command::args */ IRCCD_EXPORT std::vector args() const override; /** - * \copydoc RemoteCommand::exec + * \copydoc Command::exec */ IRCCD_EXPORT json::Value exec(Irccd &irccd, const json::Value &request) const override; }; diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-server-cmode.cpp --- a/lib/irccd/cmd-server-cmode.cpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-server-cmode.cpp Thu Jun 09 13:50:55 2016 +0200 @@ -26,7 +26,7 @@ namespace command { ServerChannelMode::ServerChannelMode() - : RemoteCommand("server-cmode", "Server") + : Command("server-cmode", "Server") { } @@ -35,7 +35,7 @@ return ""; } -std::vector ServerChannelMode::args() const +std::vector ServerChannelMode::args() const { return { { "server", true }, @@ -51,7 +51,7 @@ request.at("mode").toString() ); - return RemoteCommand::exec(irccd, request); + return Command::exec(irccd, request); } } // !command diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-server-cmode.hpp --- a/lib/irccd/cmd-server-cmode.hpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-server-cmode.hpp Thu Jun 09 13:50:55 2016 +0200 @@ -34,7 +34,7 @@ * \class ServerChannelMode * \brief Implementation of server-cmode transport command. */ -class ServerChannelMode : public RemoteCommand { +class ServerChannelMode : public Command { public: /** * Constructor. @@ -42,17 +42,17 @@ IRCCD_EXPORT ServerChannelMode(); /** - * \copydoc RemoteCommand::help + * \copydoc Command::help */ IRCCD_EXPORT std::string help() const override; /** - * \copydoc RemoteCommand::args + * \copydoc Command::args */ IRCCD_EXPORT std::vector args() const override; /** - * \copydoc RemoteCommand::exec + * \copydoc Command::exec */ IRCCD_EXPORT json::Value exec(Irccd &irccd, const json::Value &request) const override; }; diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-server-cnotice.cpp --- a/lib/irccd/cmd-server-cnotice.cpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-server-cnotice.cpp Thu Jun 09 13:50:55 2016 +0200 @@ -26,7 +26,7 @@ namespace command { ServerChannelNotice::ServerChannelNotice() - : RemoteCommand("server-cnotice", "Server") + : Command("server-cnotice", "Server") { } @@ -35,7 +35,7 @@ return ""; } -std::vector ServerChannelNotice::args() const +std::vector ServerChannelNotice::args() const { return { { "server", true }, @@ -51,7 +51,7 @@ request.at("message").toString() ); - return RemoteCommand::exec(irccd, request); + return Command::exec(irccd, request); } } // !command diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-server-cnotice.hpp --- a/lib/irccd/cmd-server-cnotice.hpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-server-cnotice.hpp Thu Jun 09 13:50:55 2016 +0200 @@ -43,7 +43,7 @@ * "message": "the message" * } */ -class ServerChannelNotice : public RemoteCommand { +class ServerChannelNotice : public Command { public: /** * Constructor. @@ -51,17 +51,17 @@ IRCCD_EXPORT ServerChannelNotice(); /** - * \copydoc RemoteCommand::help + * \copydoc Command::help */ IRCCD_EXPORT std::string help() const override; /** - * \copydoc RemoteCommand::args + * \copydoc Command::args */ IRCCD_EXPORT std::vector args() const override; /** - * \copydoc RemoteCommand::exec + * \copydoc Command::exec */ IRCCD_EXPORT json::Value exec(Irccd &irccd, const json::Value &request) const override; }; diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-server-connect.cpp --- a/lib/irccd/cmd-server-connect.cpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-server-connect.cpp Thu Jun 09 13:50:55 2016 +0200 @@ -116,7 +116,7 @@ } // !namespace ServerConnect::ServerConnect() - : RemoteCommand("server-connect", "Server") + : Command("server-connect", "Server") { } @@ -125,7 +125,7 @@ return "Connect to a server."; } -std::vector ServerConnect::options() const +std::vector ServerConnect::options() const { return { { "command", "c", "command", "char", "command character to use" }, @@ -137,7 +137,7 @@ }; } -std::vector ServerConnect::args() const +std::vector ServerConnect::args() const { return { { "id", true }, @@ -155,7 +155,7 @@ irccd.serverService().add(std::move(server)); - return RemoteCommand::exec(irccd, request); + return Command::exec(irccd, request); } } // !command diff -r 786559f1937f -r c26754e419c4 lib/irccd/cmd-server-connect.hpp --- a/lib/irccd/cmd-server-connect.hpp Thu Jun 09 13:47:40 2016 +0200 +++ b/lib/irccd/cmd-server-connect.hpp Thu Jun 09 13:50:55 2016 +0200 @@ -34,7 +34,7 @@ * \class ServerConnect * \brief Implementation of server-connect transport command. */ -class ServerConnect : public RemoteCommand { +class ServerConnect : public Command { public: /** * Constructor. @@ -42,22 +42,22 @@ IRCCD_EXPORT ServerConnect(); /** - * \copydoc RemoteCommand::help + * \copydoc Command::help */ IRCCD_EXPORT std::string help() const override; /** - * \copydoc RemoteCommand::options + * \copydoc Command::options */ IRCCD_EXPORT std::vector