view irccdctl/cli-plugin-load.cpp @ 337:492bd7c9ecc4

Irccdctl: bring back server-part
author David Demelier <markand@malikania.fr>
date Thu, 10 Nov 2016 13:10:27 +0100
parents df5cc5e6b499
children
line wrap: on
line source

/*
 * cli-plugin-load.cpp -- implementation of irccdctl plugin-load
 *
 * Copyright (c) 2013-2016 David Demelier <markand@malikania.fr>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include "cli-plugin-load.hpp"

namespace irccd {

namespace cli {

PluginLoadCli::PluginLoadCli()
    : Cli("plugin-load",
          "load a plugin",
          "plugin-load logger",
          "Load a plugin into the irccd instance.\n\n"
          "Example:\n"
          "\tirccdctl plugin-load logger")
{
}

void PluginLoadCli::exec(Irccdctl &irccdctl, const std::vector<std::string> &args)
{
    if (args.size() < 1)
        throw std::invalid_argument("plugin-load requires 1 argument");

    check(request(irccdctl, {{"plugin", args[0]}}));
}

} // !cli

} // !irccd