summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/wee-command.c4
-rw-r--r--src/gui/gui-completion.c58
2 files changed, 14 insertions, 48 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 41b3bfeb1..c04281e6d 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -100,7 +100,7 @@ struct command weechat_commands[] =
N_("command"),
N_("command: command to execute (a '/' is automatically added if not "
"found at beginning of command)\n"),
- "%w|%i", 0, MAX_ARGS, 1, command_builtin },
+ "%w", 0, MAX_ARGS, 1, command_builtin },
{ "clear",
N_("clear window(s)"),
N_("[-all | number [number ...]]"),
@@ -119,7 +119,7 @@ struct command weechat_commands[] =
N_("display help about commands"),
N_("[command]"),
N_("command: name of a WeeChat or IRC command"),
- "%w|%i|%h", 0, 1, 0, command_help },
+ "%w|%h", 0, 1, 0, command_help },
{ "history",
N_("show buffer command history"),
N_("[clear | value]"),
diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c
index bf0eb279d..44e56832a 100644
--- a/src/gui/gui-completion.c
+++ b/src/gui/gui-completion.c
@@ -454,54 +454,23 @@ gui_completion_list_add_filename (struct t_gui_completion *completion)
}
/*
- * gui_completion_list_add_plugin_cmd: add plugin command handlers to completion list
+ * gui_completion_list_add_command_hooks: add command hooks to completion list
*/
void
-gui_completion_list_add_plugin_cmd (struct t_gui_completion *completion)
+gui_completion_list_add_command_hooks (struct t_gui_completion *completion)
{
- (void) completion;
- /*t_weechat_plugin *ptr_plugin;
- t_plugin_handler *ptr_handler;
-
- for (ptr_plugin = weechat_plugins; ptr_plugin;
- ptr_plugin = ptr_plugin->next_plugin)
- {
- for (ptr_handler = ptr_plugin->handlers;
- ptr_handler; ptr_handler = ptr_handler->next_handler)
- {
- if (ptr_handler->type == PLUGIN_HANDLER_COMMAND)
- gui_completion_list_add (completion, ptr_handler->command,
- 0, WEELIST_POS_SORT);
- }
- }*/
-}
-
-/*
- * gui_completion_list_add_protocol_commands: add protocol commands to completion list
- */
-
-void
-gui_completion_list_add_protocol_commands (struct t_gui_completion *completion)
-{
- (void) completion;
+ struct t_hook *ptr_hook;
- /*int i;
- t_weechat_protocol *ptr_protocol;
-
- ptr_protocol = completion->buffer->protocol;
-
- if (ptr_protocol && ptr_protocol->commands)
+ for (ptr_hook = weechat_hooks; ptr_hook; ptr_hook = ptr_hook->next_hook)
{
- i = 0;
- while (ptr_protocol->commands[i].name)
- {
+ if ((ptr_hook->type == HOOK_TYPE_COMMAND)
+ && (HOOK_COMMAND(ptr_hook, command))
+ && (HOOK_COMMAND(ptr_hook, command)[0]))
gui_completion_list_add (completion,
- ptr_protocol->commands[i].name,
- 0, WEELIST_POS_SORT);
- i++;
- }
- }*/
+ HOOK_COMMAND(ptr_hook, command),
+ 0, WEELIST_POS_SORT);
+ }
}
/*
@@ -1023,11 +992,8 @@ gui_completion_build_list_template (struct t_gui_completion *completion, char *t
case 'f': /* filename */
gui_completion_list_add_filename (completion);
break;
- case 'h': /* plugin command handlers */
- gui_completion_list_add_plugin_cmd (completion);
- break;
- case 'i': /* protocol commands */
- gui_completion_list_add_protocol_commands (completion);
+ case 'h': /* commands hooks */
+ gui_completion_list_add_command_hooks (completion);
break;
case 'k': /* key cmd/funtcions*/
gui_completion_list_add_key_cmd (completion);