summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorTingPing <TingPing@users.noreply.github.com>2013-09-10 02:24:53 -0400
committerTingPing <TingPing@users.noreply.github.com>2013-09-10 02:24:53 -0400
commitb9df78b9c643e9e44c78f0eaac413c5ee14000c3 (patch)
tree31f9204ebd298e5c5d3de87e0d073d980ff5f941
parent9a3c1ccd727feb9446847262404f5878aae9227e (diff)
Exec: Print help on empty string
... and bump version
-rw-r--r--plugins/exec/exec.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/plugins/exec/exec.c b/plugins/exec/exec.c
index 233a884f..d83a4d74 100644
--- a/plugins/exec/exec.c
+++ b/plugins/exec/exec.c
@@ -28,7 +28,7 @@
 static hexchat_plugin *ph;   /* plugin handle */
 static char name[] = "Exec";
 static char desc[] = "Execute commands inside HexChat";
-static char version[] = "1.1";
+static char version[] = "1.2";
 
 static int
 run_command (char *word[], char *word_eol[], void *userdata)
@@ -115,21 +115,25 @@ run_command (char *word[], char *word_eol[], void *userdata)
 			}
 			timeElapsed = difftime (time (0), start);
 		}
-	}
 
-	/* display a newline to separate things */
-	if (!announce)
-		hexchat_printf (ph, "\n");
+		/* display a newline to separate things */
+		if (!announce)
+			hexchat_printf (ph, "\n");
+
+		if (timeElapsed >= 10)
+		{
+			hexchat_printf (ph, "Command took too much time to run, execution aborted.\n");
+		}
 
-	if (timeElapsed >= 10)
+		CloseHandle (readPipe);
+		CloseHandle (pInfo.hProcess);
+		CloseHandle (pInfo.hThread);
+	}
+	else
 	{
-		hexchat_printf (ph, "Command took too much time to run, execution aborted.\n");
+		hexchat_command (ph, "help exec");
 	}
 
-	CloseHandle (readPipe);
-	CloseHandle (pInfo.hProcess);
-	CloseHandle (pInfo.hThread);
-
 	return HEXCHAT_EAT_HEXCHAT;
 }