Skip to contents

Run a command's REPL handler with positional/keyword arguments

Usage

run_stat_command(name, ...)

Arguments

name

Command name or alias.

...

Arguments forwarded to the REPL handler.

Value

Whatever the handler returns. Stops with an informative error if the command is not registered.

Examples

cmd <- stat_command("demo_echo", "misc", "demo_echo",
                    "Echo demo command",
                    handler_repl = function(...) "ok")
register_stat_command(cmd)
run_stat_command("demo_echo")
#> [1] "ok"