1
0
mirror of https://github.com/Tha14/toxic.git synced 2026-01-28 21:53:15 +01:00

improve command parsing so you don't need quotes & add group ignoring

This commit is contained in:
Jfreegman
2015-01-12 15:03:23 -05:00
parent 89637e7d2f
commit 7ee858110c
8 changed files with 150 additions and 39 deletions

View File

@@ -524,18 +524,7 @@ void cmd_note(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA
return;
}
if (argv[1][0] != '\"') {
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Note must be enclosed in quotes.");
return;
}
/* remove opening and closing quotes */
char msg[MAX_STR_SIZE];
snprintf(msg, sizeof(msg), "%s", &argv[1][1]);
int len = strlen(msg) - 1;
msg[len] = '\0';
prompt_update_statusmessage(prompt, m, msg);
prompt_update_statusmessage(prompt, m, argv[1]);
}
void cmd_prompt_help(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE])