summary refs log tree commit diff stats
path: root/plugins/exec
diff options
context:
space:
mode:
authorBerke Viktor <berkeviktor@aol.com>2011-12-03 19:53:20 +0100
committerBerke Viktor <berkeviktor@aol.com>2011-12-03 19:53:20 +0100
commit6fc70632316076a477fcc438812e52fa21d67b15 (patch)
treeeb821f85dfc7c742e47d6a8a9183b56618d512f2 /plugins/exec
parent4a127d0bb4c3a265c7ffef9bdbd449aac8311c8a (diff)
placeholder for /exec -o
Diffstat (limited to 'plugins/exec')
-rw-r--r--plugins/exec/exec.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/exec/exec.c b/plugins/exec/exec.c
index f9450210..22f38814 100644
--- a/plugins/exec/exec.c
+++ b/plugins/exec/exec.c
@@ -28,7 +28,7 @@
 static xchat_plugin *ph;   /* plugin handle */
 static const char name[] = "Exec";
 static const char desc[] = "Execute commands inside XChat";
-static const char version[] = "1.0";
+static const char version[] = "1.1";
 
 static int
 run_command (char *word[], char *word_eol[], void *userdata)
@@ -54,7 +54,17 @@ run_command (char *word[], char *word_eol[], void *userdata)
 	if (strlen (word[2]) > 0)
 	{
 		strcpy (commandLine, "cmd.exe /c ");
-		strcat (commandLine, word_eol[2]);
+
+		if (!stricmp("-O", word[2]))
+		{
+			/*strcat (commandLine, word_eol[3]);*/
+			xchat_printf (ph, "Printing Exec output to others is not supported yet.\n");
+			return XCHAT_EAT_XCHAT;
+		}
+		else
+		{
+			strcat (commandLine, word_eol[2]);
+		}
 
 		CreatePipe (&readPipe, &writePipe, &secattr, 0); /* might be replaced with MyCreatePipeEx */
 
@@ -114,7 +124,7 @@ xchat_plugin_init (xchat_plugin *plugin_handle, char **plugin_name, char **plugi
 	*plugin_desc = desc;
 	*plugin_version = version;
 
-	xchat_hook_command (ph, "EXEC", XCHAT_PRI_NORM, run_command, 0, 0);
+	xchat_hook_command (ph, "EXEC", XCHAT_PRI_NORM, run_command, "Usage: /EXEC [-O] - execute commands inside XChat", 0);
 	xchat_printf (ph, "%s plugin loaded\n", name);
 
 	return 1;       /* return 1 for success */