Added /script run

This commit is contained in:
James Booth
2015-10-15 23:57:52 +01:00
parent ea4fb2ce6c
commit 0769fc6b1b
3 changed files with 50 additions and 2 deletions

View File

@@ -49,6 +49,7 @@
#include "config/preferences.h"
#include "config/theme.h"
#include "config/tlscerts.h"
#include "config/scripts.h"
#include "contact.h"
#include "roster_list.h"
#include "jid.h"
@@ -689,6 +690,21 @@ cmd_account(ProfWin *window, const char * const command, gchar **args)
return TRUE;
}
gboolean
cmd_script(ProfWin *window, const char * const command, gchar **args)
{
if ((g_strcmp0(args[0], "run") == 0) && args[1]) {
gboolean res = scripts_exec(args[1]);
if (!res) {
cons_show("Could not find script %s", args[1]);
}
} else {
cons_bad_cmd_usage(command);
}
return TRUE;
}
gboolean
cmd_sub(ProfWin *window, const char * const command, gchar **args)
{