Class aliasmgr
Alias Manager
Info:
- Copyright: 2022 Damian Monogue
- License: MIT, see LICENSE.lua
- Author: Damian Monogue
Methods
aliasmgr:new() | Creates a new alias manager |
aliasmgr:register(name, regex, func) | Registers an alias with the alias manager |
aliasmgr:add(name, regex, func) | Registers an alias with the alias manager. |
aliasmgr:disable(name) | Disables an alias, but does not delete it so it can be enabled later without being redefined |
aliasmgr:disableAll() | Disables all aliases registered with the manager |
aliasmgr:enable(name) | Enables an alias by name |
aliasmgr:enableAll() | Enables all aliases registered with the manager |
aliasmgr:kill(name) | Kill an alias, deleting it from the manager |
aliasmgr:killAll() | Kills all aliases registered with the manager, clearing it out |
aliasmgr:delete(name) | Kills an alias, deleting it from the manager |
aliasmgr:deleteAll() | Kills all aliases, deleting them from the manager |
aliasmgr:getAliases() | Returns the list of aliases and the information being tracked for them |
Methods
- aliasmgr:new() line 10
- Creates a new alias manager
- aliasmgr:register(name, regex, func) line 27
-
Registers an alias with the alias manager
Parameters:
- name the name for the alias
- regex the regular expression the alias matches against
- func The code to run when the alias matches. Can wrap code in [[ ]] or pass an actual function
- aliasmgr:add(name, regex, func) line 63
-
Registers an alias with the alias manager. Alias for register
Parameters:
- name the name for the alias
- regex the regular expression the alias matches against
- func The code to run when the alias matches. Can wrap code in [[ ]] or pass an actual function
See also:
- aliasmgr:disable(name) line 70
-
Disables an alias, but does not delete it so it can be enabled later without being redefined
Parameters:
- name the name of the alias to disable
Returns:
-
true if the alias exists and gets disabled, false if it does not exist or is already disabled
- aliasmgr:disableAll() line 86
- Disables all aliases registered with the manager
- aliasmgr:enable(name) line 96
-
Enables an alias by name
Parameters:
- name the name of the alias to enable
Returns:
-
true if the alias exists and was enabled, false if it does not exist.
- aliasmgr:enableAll() line 110
- Enables all aliases registered with the manager
- aliasmgr:kill(name) line 121
-
Kill an alias, deleting it from the manager
Parameters:
- name the name of the alias to kill
Returns:
-
true if the alias exists and gets deleted, false if the alias does not exist
- aliasmgr:killAll() line 137
- Kills all aliases registered with the manager, clearing it out
- aliasmgr:delete(name) line 148
-
Kills an alias, deleting it from the manager
Parameters:
- name the name of the alias to delete
Returns:
-
true if the alias exists and gets deleted, false if the alias does not exist
See also:
- aliasmgr:deleteAll() line 154
-
Kills all aliases, deleting them from the manager
See also:
- aliasmgr:getAliases() line 160
-
Returns the list of aliases and the information being tracked for them
Returns:
-
the table of alias information, with names as keys and a table of information as the values.