mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-20 07:56:21 +00:00
Added new help format to c plugins WIP
This commit is contained in:
@@ -91,7 +91,7 @@ plugins_run_command(const char * const input)
|
||||
gboolean result;
|
||||
gchar **args = parse_args(input, command->min_args, command->max_args, &result);
|
||||
if (result == FALSE) {
|
||||
ui_invalid_command_usage(command->usage, NULL);
|
||||
ui_invalid_command_usage(command->command_name, NULL);
|
||||
g_strfreev(split);
|
||||
return TRUE;
|
||||
} else {
|
||||
@@ -107,6 +107,22 @@ plugins_run_command(const char * const input)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CommandHelp*
|
||||
plugins_get_help(const char *const cmd)
|
||||
{
|
||||
GSList *curr = p_commands;
|
||||
while (curr) {
|
||||
PluginCommand *command = curr->data;
|
||||
if (g_strcmp0(cmd, command->command_name) == 0) {
|
||||
return command->help;
|
||||
}
|
||||
|
||||
curr = g_slist_next(curr);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
plugins_run_timed(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user