From d4ea20b5551a94efde2a3f126744e338dc676d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Pettersson?= Date: Fri, 19 Sep 2014 17:03:10 +0200 Subject: [PATCH] Tweaked command /tox, added completion. --- src/tox-weechat-commands.c | 16 ++++++++++------ src/tox-weechat-completion.c | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/tox-weechat-commands.c b/src/tox-weechat-commands.c index d7b27bd..57c38da 100644 --- a/src/tox-weechat-commands.c +++ b/src/tox-weechat-commands.c @@ -559,7 +559,7 @@ tox_weechat_cmd_tox(void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_OK; } - else if (argc == 3 && (weechat_strcasecmp(argv[1], "add") == 0)) + else if (argc == 3 && (weechat_strcasecmp(argv[1], "create") == 0)) { char *name = argv[2]; @@ -672,12 +672,16 @@ tox_weechat_commands_init() weechat_hook_command("tox", "manage Tox identities", "list" - " || add " - " || del " + " || create " + " || delete " " || connect ", " list: list all Tox identity\n" - " add: create a new Tox identity\n" - " del: delete a Tox identity\n" + " create: create a new Tox identity\n" + " delete: delete a Tox identity\n" "connect: connect a Tox identity to the network\n", - NULL, tox_weechat_cmd_tox, NULL); + "list" + " || add" + " || delete %(tox_identities)" + " || connect %(tox_identities)", + tox_weechat_cmd_tox, NULL); } diff --git a/src/tox-weechat-completion.c b/src/tox-weechat-completion.c index e5a8759..7aa5b34 100644 --- a/src/tox-weechat-completion.c +++ b/src/tox-weechat-completion.c @@ -29,7 +29,7 @@ tox_weechat_completion_identity(void *data, void tox_weechat_completion_init() { - weechat_hook_completion("tox_identity", + weechat_hook_completion("tox_identities", "identity", tox_weechat_completion_identity, NULL); }