mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 04:43:34 +02:00
Add 'list' option to bind command to list all the available commands and remove
hardcoded list in bind help. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4835 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
f9376ec8e7
commit
547e3defc2
4 changed files with 18 additions and 65 deletions
|
|
@ -670,7 +670,7 @@ static void cmd_show_keys(const char *searchkey, int full)
|
|||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_FOOTER);
|
||||
}
|
||||
|
||||
/* SYNTAX: BIND [-delete] [<key> [<command> [<data>]]] */
|
||||
/* SYNTAX: BIND [-list] [-delete] [<key> [<command> [<data>]]] */
|
||||
static void cmd_bind(const char *data)
|
||||
{
|
||||
GHashTable *optlist;
|
||||
|
|
@ -682,6 +682,19 @@ static void cmd_bind(const char *data)
|
|||
"bind", &optlist, &key, &id, &keydata))
|
||||
return;
|
||||
|
||||
if (g_hash_table_lookup(optlist, "list")) {
|
||||
GSList *tmp;
|
||||
|
||||
for (tmp = keyinfos; tmp != NULL; tmp = tmp->next) {
|
||||
KEYINFO_REC *rec = tmp->data;
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_COMMAND_LIST,
|
||||
rec->id, rec->description ? rec->description : "");
|
||||
}
|
||||
cmd_params_free(free_arg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (*key != '\0' && g_hash_table_lookup(optlist, "delete")) {
|
||||
/* delete key */
|
||||
key_configure_remove(key);
|
||||
|
|
@ -840,7 +853,7 @@ void keyboard_init(void)
|
|||
signal_add("complete command bind", (SIGNAL_FUNC) sig_complete_bind);
|
||||
|
||||
command_bind("bind", NULL, (SIGNAL_FUNC) cmd_bind);
|
||||
command_set_options("bind", "delete");
|
||||
command_set_options("bind", "delete list");
|
||||
}
|
||||
|
||||
void keyboard_deinit(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue