mirror of
https://github.com/moparisthebest/hexchat
synced 2024-11-25 02:32:27 -05:00
Exec: Print help on empty string
... and bump version
This commit is contained in:
parent
9a3c1ccd72
commit
b9df78b9c6
@ -28,7 +28,7 @@
|
|||||||
static hexchat_plugin *ph; /* plugin handle */
|
static hexchat_plugin *ph; /* plugin handle */
|
||||||
static char name[] = "Exec";
|
static char name[] = "Exec";
|
||||||
static char desc[] = "Execute commands inside HexChat";
|
static char desc[] = "Execute commands inside HexChat";
|
||||||
static char version[] = "1.1";
|
static char version[] = "1.2";
|
||||||
|
|
||||||
static int
|
static int
|
||||||
run_command (char *word[], char *word_eol[], void *userdata)
|
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);
|
timeElapsed = difftime (time (0), start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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");
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseHandle (readPipe);
|
||||||
|
CloseHandle (pInfo.hProcess);
|
||||||
|
CloseHandle (pInfo.hThread);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
/* 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");
|
hexchat_command (ph, "help exec");
|
||||||
}
|
}
|
||||||
|
|
||||||
CloseHandle (readPipe);
|
|
||||||
CloseHandle (pInfo.hProcess);
|
|
||||||
CloseHandle (pInfo.hThread);
|
|
||||||
|
|
||||||
return HEXCHAT_EAT_HEXCHAT;
|
return HEXCHAT_EAT_HEXCHAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user