Mercurial > irccd
comparison irccdctl/cli.cpp @ 355:ace71e2b8e2a
Irccd: add server-topic support again
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 14 Nov 2016 21:40:10 +0100 |
parents | b59767d7f3d3 |
children | 6d598fea2689 |
comparison
equal
deleted
inserted
replaced
354:6b0e202ed9a0 | 355:ace71e2b8e2a |
---|---|
801 object["server"] = args[0]; | 801 object["server"] = args[0]; |
802 | 802 |
803 check(request(irccdctl, object)); | 803 check(request(irccdctl, object)); |
804 } | 804 } |
805 | 805 |
806 /* | |
807 * ServerTopicCli. | |
808 * ------------------------------------------------------------------ | |
809 */ | |
810 | |
811 ServerTopicCli::ServerTopicCli() | |
812 : Cli("server-topic", | |
813 "change channel topic", | |
814 "server-topic server channel topic", | |
815 "Change the topic of the specified channel.\n\n" | |
816 "Example:\n" | |
817 "\tirccdctl server-topic freenode #wmfs \"This is the best channel\"") | |
818 { | |
819 } | |
820 | |
821 void ServerTopicCli::exec(Irccdctl &irccdctl, const std::vector<std::string> &args) | |
822 { | |
823 if (args.size() < 3) | |
824 throw std::invalid_argument("server-topic requires 3 arguments"); | |
825 | |
826 check(request(irccdctl, { | |
827 { "server", args[0] }, | |
828 { "channel", args[1] }, | |
829 { "topic", args[2] } | |
830 })); | |
831 } | |
832 | |
806 } // !cli | 833 } // !cli |
807 | 834 |
808 } // !irccd | 835 } // !irccd |