2022-12-15 04:00:54 +00:00
|
|
|
---
|
2023-08-26 15:30:51 +00:00
|
|
|
title: Module hilbish.aliases
|
2022-12-15 04:00:54 +00:00
|
|
|
description: command aliasing
|
|
|
|
layout: doc
|
|
|
|
menu:
|
|
|
|
docs:
|
|
|
|
parent: "API"
|
|
|
|
---
|
|
|
|
|
|
|
|
## Introduction
|
|
|
|
The alias interface deals with all command aliases in Hilbish.
|
|
|
|
|
|
|
|
## Functions
|
2023-09-02 18:18:40 +00:00
|
|
|
|||
|
|
|
|
|----|----|
|
2023-12-04 00:54:00 +00:00
|
|
|
|<a href="#aliases.add">add(alias, cmd)</a>|This is an alias (ha) for the [hilbish.alias](../#alias) function.|
|
2023-09-02 18:18:40 +00:00
|
|
|
|<a href="#aliases.delete">delete(name)</a>|Removes an alias.|
|
2023-12-04 00:54:00 +00:00
|
|
|
|<a href="#aliases.list">list() -> table[string, string]</a>|Get a table of all aliases, with string keys as the alias and the value as the command.|
|
|
|
|
|<a href="#aliases.resolve">resolve(alias) -> string?</a>|Resolves an alias to its original command. Will thrown an error if the alias doesn't exist.|
|
2023-09-02 18:18:40 +00:00
|
|
|
|
2023-12-18 14:16:57 +00:00
|
|
|
<hr>
|
|
|
|
<div id='aliases.add'>
|
2023-09-02 18:18:40 +00:00
|
|
|
<h4 class='heading'>
|
|
|
|
hilbish.aliases.add(alias, cmd)
|
|
|
|
<a href="#aliases.add" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
|
|
|
|
2023-12-04 00:54:00 +00:00
|
|
|
This is an alias (ha) for the [hilbish.alias](../#alias) function.
|
2023-12-25 23:52:16 +00:00
|
|
|
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
|
|
|
This function has no parameters.
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|
2023-12-18 14:16:57 +00:00
|
|
|
<hr>
|
|
|
|
<div id='aliases.delete'>
|
2023-09-02 18:18:40 +00:00
|
|
|
<h4 class='heading'>
|
|
|
|
hilbish.aliases.delete(name)
|
|
|
|
<a href="#aliases.delete" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2023-12-02 12:23:49 +00:00
|
|
|
Removes an alias.
|
2023-12-25 23:52:16 +00:00
|
|
|
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
2023-12-04 00:54:00 +00:00
|
|
|
`string` **`name`**
|
|
|
|
|
|
|
|
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|
2023-12-18 14:16:57 +00:00
|
|
|
<hr>
|
|
|
|
<div id='aliases.list'>
|
2023-09-02 18:18:40 +00:00
|
|
|
<h4 class='heading'>
|
2023-12-04 00:54:00 +00:00
|
|
|
hilbish.aliases.list() -> table[string, string]
|
2023-09-02 18:18:40 +00:00
|
|
|
<a href="#aliases.list" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2023-12-02 12:23:49 +00:00
|
|
|
Get a table of all aliases, with string keys as the alias and the value as the command.
|
2023-12-25 23:52:16 +00:00
|
|
|
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
|
|
|
This function has no parameters.
|
2023-12-04 00:54:00 +00:00
|
|
|
#### Example
|
|
|
|
```lua
|
|
|
|
hilbish.aliases.add('hi', 'echo hi')
|
|
|
|
|
|
|
|
local aliases = hilbish.aliases.list()
|
|
|
|
-- -> {hi = 'echo hi'}
|
2023-12-18 02:20:41 +00:00
|
|
|
```
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|
2023-12-18 14:16:57 +00:00
|
|
|
<hr>
|
|
|
|
<div id='aliases.resolve'>
|
2023-09-02 18:18:40 +00:00
|
|
|
<h4 class='heading'>
|
2023-12-04 00:54:00 +00:00
|
|
|
hilbish.aliases.resolve(alias) -> string?
|
2023-09-02 18:18:40 +00:00
|
|
|
<a href="#aliases.resolve" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2023-12-04 00:54:00 +00:00
|
|
|
Resolves an alias to its original command. Will thrown an error if the alias doesn't exist.
|
2023-12-25 23:52:16 +00:00
|
|
|
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
2023-12-04 00:54:00 +00:00
|
|
|
`string` **`alias`**
|
|
|
|
|
|
|
|
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|