summaryrefslogtreecommitdiff
path: root/src/plugins/alias
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/alias')
-rw-r--r--src/plugins/alias/alias-command.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/alias/alias-command.c b/src/plugins/alias/alias-command.c
index 260419916..50d5fd7f2 100644
--- a/src/plugins/alias/alias-command.c
+++ b/src/plugins/alias/alias-command.c
@@ -277,6 +277,20 @@ alias_command_cb (const void *pointer, void *data,
return WEECHAT_RC_OK;
}
+ if (weechat_strcmp (argv[1], "missing") == 0)
+ {
+ for (i = 0; alias_default[i][0]; i++)
+ {
+ if (!alias_search (alias_default[i][0]))
+ {
+ alias_command_add (alias_default[i][0], /* name */
+ alias_default[i][1], /* command */
+ alias_default[i][2]); /* completion */
+ }
+ }
+ return WEECHAT_RC_OK;
+ }
+
WEECHAT_COMMAND_ERROR;
}
@@ -294,7 +308,8 @@ alias_command_init ()
" || add <alias> [<command>[;<command>...]]"
" || addcompletion <completion> <alias> [<command>[;<command>...]]"
" || del <alias> [<alias>...]"
- " || rename <alias> <new_alias>"),
+ " || rename <alias> <new_alias>"
+ " || missing"),
/* xgettext:no-c-format */
N_(" list: list aliases (without argument, this list is "
"displayed)\n"
@@ -302,6 +317,7 @@ alias_command_init ()
"addcompletion: add an alias with a custom completion\n"
" del: delete an alias\n"
" rename: rename an alias\n"
+ " missing: add missing aliases (using default aliases)\n"
" completion: completion for alias: by default completion is "
"done with target command\n"
" note: you can use %%command to use completion of "
@@ -337,6 +353,7 @@ alias_command_init ()
" || add %(alias) %(commands:/)|%(alias_value)"
" || addcompletion %- %(alias) %(commands:/)|%(alias_value)"
" || del %(alias)|%*"
- " || rename %(alias) %(alias)",
+ " || rename %(alias) %(alias)"
+ " || missing",
&alias_command_cb, NULL, NULL);
}