Mercurial > irccd
comparison irccdctl/cli-plugin-reload.cpp @ 323:d178defe9d2a
Irccdctl: bring back plugin-reload
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 03 Nov 2016 13:18:30 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
322:df5cc5e6b499 | 323:d178defe9d2a |
---|---|
1 /* | |
2 * command-plugin-reload.cpp -- implementation of irccdctl plugin-reload | |
3 * | |
4 * Copyright (c) 2013-2016 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #include "cli-plugin-reload.hpp" | |
20 | |
21 namespace irccd { | |
22 | |
23 namespace cli { | |
24 | |
25 PluginReloadCli::PluginReloadCli() | |
26 : Cli("plugin-reload", | |
27 "reload a plugin", | |
28 "plugin-reload plugin", | |
29 "Call the onReload event on the specified plugin.") | |
30 { | |
31 } | |
32 | |
33 void PluginReloadCli::exec(Irccdctl &irccdctl, const std::vector<std::string> &args) | |
34 { | |
35 if (args.size() < 1) | |
36 throw std::invalid_argument("plugin-reload requires 1 argument"); | |
37 | |
38 check(request(irccdctl, {{ "plugin", args[0] }})); | |
39 } | |
40 | |
41 } // !command | |
42 | |
43 } // !irccd |