Commit 95d1885459fb41d4932d305a9dc55eab42ef008b Parent: 2d3e36f7388e0a9907994b441e7382ce8721994a Author: mcol <mcol@posteo.net> Date: 2021-02-24 22:55:34 +0000 Committer: mcol <mcol@posteo.net> Committed: 2021-02-24 22:55:34 +0000 print message if unknown client command given
src/keybind.c Modified
@@ -312,7 +312,7 @@ void add_binding(char *message, char *response) { char *s; if (!(s = strtok(NULL, " \t\n\r"))) { - sprintf(response, "What do you want to bind?."); + sprintf(response, "What do you want to bind?"); return; }
src/ipc.c Modified
@@ -32,7 +32,9 @@ // <action> <data> else { - do_action(message, response); + if (!do_action(message, response)) { + sprintf(response, "Sorry, I don't recognise that command."); + } } }
src/action.h Modified
@@ -3,7 +3,7 @@ #include "types.h" -void do_action(char *message, char *response); +bool do_action(char *message, char *response); void terminate(void *data); void exec_command(void *data); void change_vt(void *data);
src/action.c Modified
@@ -13,10 +13,12 @@ #include "types.h" -void do_action(char *message, char *response) { +bool do_action(char *message, char *response) { char *s; + bool handled = false; if (!strcasecmp(message, "to_region")) { + handled = true; if ((s = strtok(NULL, " \t\n\r"))) { struct wlr_box box; if (wlr_box_from_str(s, &box)) { @@ -24,6 +26,8 @@ } } } + + return handled; }