diff options
Diffstat (limited to 'client/cmd.h')
-rw-r--r-- | client/cmd.h | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/client/cmd.h b/client/cmd.h index 509104a..7ec67fc 100644 --- a/client/cmd.h +++ b/client/cmd.h @@ -5,19 +5,56 @@ typedef void cmd_fn_t(char *); struct cmd { - const char* name; void (* handle)(char *); + const char* name; const char* info; // TODO: tab completion function? }; cmd_fn_t cmd_exit; cmd_fn_t cmd_test; +cmd_fn_t cmd_help; +cmd_fn_t cmd_send; +cmd_fn_t cmd_status; +cmd_fn_t cmd_reset; +cmd_fn_t cmd_ls; static const struct cmd cmds[] = { - (struct cmd){ .name = "exit", .handle = cmd_exit, .info = NULL, }, - (struct cmd){ .name = "test", .handle = cmd_test, .info = NULL, }, + { + .handle = cmd_exit, + .name = "exit", + .info = "exit pbc", + }, + { + .handle = cmd_test, + .name = "test", + .info = "send a test puzbus message", + }, + { + .handle = cmd_help, + .name = "help", + .info = "show this help", + }, + // { + // .handle = cmd_send, + // .name = "send", + // .info = "[debug] send raw message", + // }, + // { + // .handle = cmd_status, + // .name = "status", + // .info = "show global puzzle box state (main controller state)", + // }, + // { + // .handle = cmd_reset, + // .name = "reset", + // .info = "reset entire game state", + // }, + // { + // .handle = cmd_ls, + // .name = "ls", + // .info = "list connected puzzle modules", + // }, }; - static const size_t cmds_length = sizeof(cmds) / sizeof(cmds[0]); |