0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-06 03:58:58 +02:00

modules/console: Extend arguments for options string.

This commit is contained in:
Jason Volk 2018-03-26 00:12:16 -07:00
parent 68382cb209
commit 1ceaa73e5b
3 changed files with 7 additions and 5 deletions

View file

@ -282,7 +282,7 @@ catch(const std::exception &e)
int
handle_line_bymodule(const string_view &line)
{
using prototype = int (std::ostream &, const string_view &);
using prototype = int (std::ostream &, const string_view &, const string_view &);
const ircd::mods::import<prototype> command
{
*console_module, "console_command"
@ -292,7 +292,7 @@ handle_line_bymodule(const string_view &line)
std::ostringstream ss;
pubsetbuf(ss, buf);
int ret;
switch((ret = command(ss, line)))
switch((ret = command(ss, line, {})))
{
case 0:
case 1:

View file

@ -158,7 +158,9 @@ IRCD_EXCEPTION_HIDENAME(ircd::error, bad_command)
int console_command_derived(opt &, const string_view &line);
extern "C" int
console_command(std::ostream &out, const string_view &line)
console_command(std::ostream &out,
const string_view &line,
const string_view &opts)
try
{
opt opt{out};

View file

@ -173,7 +173,7 @@ noexcept try
"console"
};
using prototype = int (std::ostream &, const string_view &);
using prototype = int (std::ostream &, const string_view &, const string_view &);
const mods::import<prototype> command
{
*console_module, "console_command"
@ -184,7 +184,7 @@ noexcept try
pubsetbuf(out, buf);
out << "<pre>";
command(out, body);
command(out, body, {});
out << "</pre>";
const auto str //TODO: X