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:
parent
68382cb209
commit
1ceaa73e5b
|
@ -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:
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue