1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 07:16:37 +02:00

Added "/debug buffer" command to see raw buffer content

This commit is contained in:
Sebastien Helleu
2007-08-31 11:21:24 +00:00
parent e05be4e2b3
commit f523d2b0a5
13 changed files with 1777 additions and 1688 deletions
+10 -2
View File
@@ -119,10 +119,11 @@ t_weechat_command weechat_commands[] =
" file: filename (on local host)"),
"chat|send|close %n %f", 1, MAX_ARGS, 0, NULL, weechat_cmd_dcc },
{ "debug", N_("print debug messages"),
N_("dump | windows"),
N_("dump | buffer | windows"),
N_(" dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)\n"
" buffer: dump buffer content with hexadecimal values in log file\n"
"windows: display windows tree"),
"dump|windows", 1, 1, 0, weechat_cmd_debug, NULL },
"dump|buffer|windows", 1, 1, 0, weechat_cmd_debug, NULL },
{ "help", N_("display help about commands"),
N_("[command]"),
N_("command: name of a WeeChat or IRC command"),
@@ -1899,12 +1900,15 @@ int
weechat_cmd_debug (t_irc_server *server, t_irc_channel *channel,
int argc, char **argv)
{
t_gui_buffer *buffer;
t_irc_server *ptr_server;
/* make C compiler happy */
(void) server;
(void) channel;
gui_buffer_find_context (server, channel, NULL, &buffer);
if (argc != 1)
{
irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
@@ -1918,6 +1922,10 @@ weechat_cmd_debug (t_irc_server *server, t_irc_channel *channel,
{
weechat_dump (0);
}
else if (ascii_strcasecmp (argv[0], "buffer") == 0)
{
gui_buffer_dump_hexa (buffer);
}
else if (ascii_strcasecmp (argv[0], "windows") == 0)
{
gui_printf_nolog (NULL, "\n");