Skip to contents

Register a stat_command in the package-level registry

Usage

register_stat_command(cmd)

Arguments

cmd

A morie_stat_command constructed by stat_command.

Value

The command name, invisibly.

Examples

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