Added new help format to c plugins WIP

This commit is contained in:
James Booth
2016-02-18 01:20:17 +00:00
parent 2ac911618a
commit a14b7815ae
12 changed files with 108 additions and 15 deletions

View File

@@ -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)
{