summaryrefslogtreecommitdiff
path: root/src/plugins/alias/alias-command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/alias/alias-command.c')
-rw-r--r--src/plugins/alias/alias-command.c45
1 files changed, 36 insertions, 9 deletions
diff --git a/src/plugins/alias/alias-command.c b/src/plugins/alias/alias-command.c
index 74c1964ff..f492faaa5 100644
--- a/src/plugins/alias/alias-command.c
+++ b/src/plugins/alias/alias-command.c
@@ -1,7 +1,7 @@
/*
* alias-command.c - alias commands
*
- * Copyright (C) 2003-2015 Sébastien Helleu <flashcode@flashtux.org>
+ * Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -76,7 +76,8 @@ alias_command_add (const char *alias_name, const char *command,
*/
int
-alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
+alias_command_cb (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
char *ptr_alias_name;
@@ -85,6 +86,7 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
int alias_found, i;
/* make C compiler happy */
+ (void) pointer;
(void) data;
(void) buffer;
@@ -123,11 +125,36 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
weechat_printf (NULL, _("All aliases:"));
}
}
- weechat_printf (NULL, " %s %s=>%s %s",
- ptr_alias->name,
- weechat_color ("chat_delimiters"),
- weechat_color ("chat"),
- ptr_alias->command);
+ ptr_option = weechat_config_search_option (
+ alias_config_file,
+ alias_config_section_completion,
+ ptr_alias->name);
+ if (ptr_option)
+ {
+ weechat_printf (
+ NULL,
+ " %s %s=>%s %s %s(%s%s %s%s)%s",
+ ptr_alias->name,
+ weechat_color ("chat_delimiters"),
+ weechat_color ("chat"),
+ ptr_alias->command,
+ weechat_color ("chat_delimiters"),
+ weechat_color ("chat"),
+ _("completion:"),
+ weechat_config_string (ptr_option),
+ weechat_color ("chat_delimiters"),
+ weechat_color ("chat"));
+ }
+ else
+ {
+ weechat_printf (
+ NULL,
+ " %s %s=>%s %s",
+ ptr_alias->name,
+ weechat_color ("chat_delimiters"),
+ weechat_color ("chat"),
+ ptr_alias->command);
+ }
alias_found = 1;
}
}
@@ -190,7 +217,7 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
ptr_option = weechat_config_search_option (
alias_config_file,
alias_config_section_cmd,
- ptr_alias_name);
+ ptr_alias_name);
if (ptr_option)
weechat_config_option_free (ptr_option);
ptr_option = weechat_config_search_option (
@@ -262,5 +289,5 @@ alias_command_init ()
" || add %(alias) %(commands)|%(alias_value)"
" || addcompletion %- %(alias) %(commands)|%(alias_value)"
" || del %(alias)|%*",
- &alias_command_cb, NULL);
+ &alias_command_cb, NULL, NULL);
}