diff --git a/docs/api/bait/index.html b/docs/api/bait/index.html index 279f620..27ff197 100644 --- a/docs/api/bait/index.html +++ b/docs/api/bait/index.html @@ -1,7 +1,7 @@ Module bait — Hilbish

Module bait

the event emitter

Introduction +

Module bait

the event emitter

Introduction

Bait is the event emitter for Hilbish. Much like Node.js and its events system, many actions in Hilbish emit events. Unlike Node.js, Hilbish events are global. So make sure to diff --git a/docs/api/commander/index.html b/docs/api/commander/index.html index 9ec63f8..a5447d0 100644 --- a/docs/api/commander/index.html +++ b/docs/api/commander/index.html @@ -1,7 +1,7 @@ Module commander — Hilbish

Module commander

library for custom commands

Introduction +

Module commander

library for custom commands

Introduction

Commander is the library which handles Hilbish commands. This makes the user able to add Lua-written commands to their shell without making a separate script in a bin folder. Instead, you may simply use the Commander diff --git a/docs/api/fs/index.html b/docs/api/fs/index.html index 9fdc756..242cb00 100644 --- a/docs/api/fs/index.html +++ b/docs/api/fs/index.html @@ -1,7 +1,7 @@ Module fs — Hilbish

Module fs

filesystem interaction and functionality library

Introduction +

Module fs

filesystem interaction and functionality library

Introduction

The fs module provides filesystem functions to Hilbish. While Lua’s standard library has some I/O functions, they’re missing a lot of the basics. The fs library offers more functions and will work on any operating system Hilbish does.

Functions diff --git a/docs/api/hilbish/hilbish.abbr/index.html b/docs/api/hilbish/hilbish.abbr/index.html new file mode 100644 index 0000000..f824a8f --- /dev/null +++ b/docs/api/hilbish/hilbish.abbr/index.html @@ -0,0 +1,21 @@ +Module hilbish.abbr — Hilbish +

Module hilbish.abbr

command line abbreviations

Introduction +

The abbr module manages Hilbish abbreviations. These are words that can be replaced +with longer command line strings when entered. +As an example, git push can be abbreviated to gp. When the user types +gp into the command line, after hitting space or enter, it will expand to git push. +Abbreviations can be used as an alternative to aliases. They are saved entirely in the history +Instead of the aliased form of the same command.

Functions +

remove(abbr)Removes the named abbr.
add(abbr, expandedfunction, opts)

hilbish.abbr.add(abbr, expanded|function, opts) +

Adds an abbreviation. The abbr is the abbreviation itself, +while expanded is what the abbreviation should expand to. +It can be either a function or a string. If it is a function, it will expand to what +the function returns. +opts is a table that accepts 1 key: anywhere. +opts.anywhere defines whether the abbr expands anywhere in the command line or not, +whereas the default behavior is only at the beginning of the line

Parameters +

abbr string

expanded|function string

opts table


hilbish.abbr.remove(abbr) +

Removes the named abbr.

Parameters +

abbr string

\ No newline at end of file diff --git a/docs/api/hilbish/hilbish.aliases/index.html b/docs/api/hilbish/hilbish.aliases/index.html index 68a00f1..d6ba938 100644 --- a/docs/api/hilbish/hilbish.aliases/index.html +++ b/docs/api/hilbish/hilbish.aliases/index.html @@ -1,7 +1,7 @@ Module hilbish.aliases — Hilbish

Module hilbish.aliases

command aliasing

Introduction +

Module hilbish.aliases

command aliasing

Introduction

The alias interface deals with all command aliases in Hilbish.

Functions

add(alias, cmd)This is an alias (ha) for the hilbish.alias function.
delete(name)Removes an alias.
list() -> table[string, string]Get a table of all aliases, with string keys as the alias and the value as the command.
resolve(alias) -> string?Resolves an alias to its original command. Will thrown an error if the alias doesn’t exist.

hilbish.aliases.add(alias, cmd) diff --git a/docs/api/hilbish/hilbish.completion/index.html b/docs/api/hilbish/hilbish.completion/index.html index 1af2e7e..f804146 100644 --- a/docs/api/hilbish/hilbish.completion/index.html +++ b/docs/api/hilbish/hilbish.completion/index.html @@ -1,7 +1,7 @@ Module hilbish.completion — Hilbish

Module hilbish.completion

tab completions

Introduction +

Module hilbish.completion

tab completions

Introduction

The completions interface deals with tab completions.

Functions

bins(query, ctx, fields) -> entries (table), prefix (string)Return binaries/executables based on the provided parameters.
call(name, query, ctx, fields) -> completionGroups (table), prefix (string)Calls a completer function. This is mainly used to call a command completer, which will have a name
files(query, ctx, fields) -> entries (table), prefix (string)Returns file matches based on the provided parameters.
handler(line, pos)This function contains the general completion handler for Hilbish. This function handles

hilbish.completion.bins(query, ctx, fields) -> entries (table), prefix (string)

Return binaries/executables based on the provided parameters.
This function is meant to be used as a helper in a command completion handler.

Parameters diff --git a/docs/api/hilbish/hilbish.editor/index.html b/docs/api/hilbish/hilbish.editor/index.html index 0ee5100..3c6691f 100644 --- a/docs/api/hilbish/hilbish.editor/index.html +++ b/docs/api/hilbish/hilbish.editor/index.html @@ -1,17 +1,19 @@ Module hilbish.editor — Hilbish

Module hilbish.editor

interactions for Hilbish's line reader

Introduction +

Module hilbish.editor

interactions for Hilbish's line reader

Introduction

The hilbish.editor interface provides functions to directly interact with the line editor in use.

Functions -

getLine() -> stringReturns the current input line.
getVimRegister(register) -> stringReturns the text that is at the register.
insert(text)Inserts text into the Hilbish command line.
getChar() -> stringReads a keystroke from the user. This is in a format of something like Ctrl-L.
setVimRegister(register, text)Sets the vim register at register to hold the passed text.

hilbish.editor.getLine() -> string -

Returns the current input line.

Parameters -

This function has no parameters.


hilbish.editor.getVimRegister(register) -> string -

Returns the text that is at the register.

Parameters -

string register


hilbish.editor.insert(text) -

Inserts text into the Hilbish command line.

Parameters -

string text


hilbish.editor.getChar() -> string -

Reads a keystroke from the user. This is in a format of something like Ctrl-L.

Parameters -

This function has no parameters.


hilbish.editor.setVimRegister(register, text) -

Sets the vim register at register to hold the passed text.

Parameters -

string text

\ No newline at end of file +
deleteByAmount(amount)Deletes characters in the line by the given amount.
getLine() -> stringReturns the current input line.
getVimRegister(register) -> stringReturns the text that is at the register.
insert(text)Inserts text into the Hilbish command line.
getChar() -> stringReads a keystroke from the user. This is in a format of something like Ctrl-L.
setVimRegister(register, text)Sets the vim register at register to hold the passed text.

hilbish.editor.deleteByAmount(amount) +

Deletes characters in the line by the given amount.

Parameters +

number amount


hilbish.editor.getLine() -> string +

Returns the current input line.

Parameters +

This function has no parameters.


hilbish.editor.getVimRegister(register) -> string +

Returns the text that is at the register.

Parameters +

string register


hilbish.editor.insert(text) +

Inserts text into the Hilbish command line.

Parameters +

string text


hilbish.editor.getChar() -> string +

Reads a keystroke from the user. This is in a format of something like Ctrl-L.

Parameters +

This function has no parameters.


hilbish.editor.setVimRegister(register, text) +

Sets the vim register at register to hold the passed text.

Parameters +

string register

string text

\ No newline at end of file diff --git a/docs/api/hilbish/hilbish.history/index.html b/docs/api/hilbish/hilbish.history/index.html index 5a89f49..dd4fc97 100644 --- a/docs/api/hilbish/hilbish.history/index.html +++ b/docs/api/hilbish/hilbish.history/index.html @@ -1,7 +1,7 @@ Module hilbish.history — Hilbish

Module hilbish.history

command history

Introduction +

Module hilbish.history

command history

Introduction

The history interface deals with command history. This includes the ability to override functions to change the main method of saving history.

Functions diff --git a/docs/api/hilbish/hilbish.jobs/index.html b/docs/api/hilbish/hilbish.jobs/index.html index 3d0adf2..8818941 100644 --- a/docs/api/hilbish/hilbish.jobs/index.html +++ b/docs/api/hilbish/hilbish.jobs/index.html @@ -1,7 +1,7 @@ Module hilbish.jobs — Hilbish

Module hilbish.jobs

background job management

Introduction +

Module hilbish.jobs

background job management

Introduction

Manage interactive jobs in Hilbish via Lua.

Jobs are the name of background tasks/commands. A job can be started via interactive usage or with the functions defined below for use in external runners.

Functions

add(cmdstr, args, execPath)Creates a new job. This function does not run the job. This function is intended to be
all() -> table[@Job]Returns a table of all job objects.
disown(id)Disowns a job. This simply deletes it from the list of jobs without stopping it.
get(id) -> @JobGet a job object via its ID.
last() -> @JobReturns the last added job to the table.

hilbish.jobs.add(cmdstr, args, execPath) diff --git a/docs/api/hilbish/hilbish.messages/index.html b/docs/api/hilbish/hilbish.messages/index.html index e0df534..1e6a340 100644 --- a/docs/api/hilbish/hilbish.messages/index.html +++ b/docs/api/hilbish/hilbish.messages/index.html @@ -1,7 +1,7 @@ Module hilbish.messages — Hilbish

Module hilbish.messages

simplistic message passing

Introduction +

Module hilbish.messages

simplistic message passing

Introduction

The messages interface defines a way for Hilbish-integrated commands, user config and other tasks to send notifications to alert the user.z The hilbish.message type is a table with the following keys: diff --git a/docs/api/hilbish/hilbish.module/index.html b/docs/api/hilbish/hilbish.module/index.html index 0d3394d..886b8bd 100644 --- a/docs/api/hilbish/hilbish.module/index.html +++ b/docs/api/hilbish/hilbish.module/index.html @@ -1,7 +1,7 @@ Module hilbish.module — Hilbish

Module hilbish.module

native module loading

Introduction +

Module hilbish.module

native module loading

Introduction

The hilbish.module interface provides a function to load Hilbish plugins/modules. Hilbish modules are Go-written plugins (see https://pkg.go.dev/plugin diff --git a/docs/api/hilbish/hilbish.os/index.html b/docs/api/hilbish/hilbish.os/index.html index df53089..92119aa 100644 --- a/docs/api/hilbish/hilbish.os/index.html +++ b/docs/api/hilbish/hilbish.os/index.html @@ -1,7 +1,7 @@ Module hilbish.os — Hilbish

Module hilbish.os

operating system info

Introduction +

\ No newline at end of file diff --git a/docs/api/hilbish/hilbish.runner/index.html b/docs/api/hilbish/hilbish.runner/index.html index bb19155..c81542c 100644 --- a/docs/api/hilbish/hilbish.runner/index.html +++ b/docs/api/hilbish/hilbish.runner/index.html @@ -1,7 +1,7 @@ Module hilbish.runner — Hilbish

Module hilbish.runner

interactive command runner customization

Introduction +

Module hilbish.runner

interactive command runner customization

Introduction

The runner interface contains functions that allow the user to change how Hilbish interprets interactive input. Users can add and change the default runner for interactive input to any diff --git a/docs/api/hilbish/hilbish.timers/index.html b/docs/api/hilbish/hilbish.timers/index.html index c9dd9d4..4331f46 100644 --- a/docs/api/hilbish/hilbish.timers/index.html +++ b/docs/api/hilbish/hilbish.timers/index.html @@ -1,7 +1,7 @@ Module hilbish.timers — Hilbish

Module hilbish.timers

timeout and interval API

Introduction +

Module hilbish.timers

timeout and interval API

Introduction

If you ever want to run a piece of code on a timed interval, or want to wait a few seconds, you don’t have to rely on timing tricks, as Hilbish has a timer API to set intervals and timeouts.

These are the simple functions hilbish.interval and hilbish.timeout (doc diff --git a/docs/api/hilbish/hilbish.userdir/index.html b/docs/api/hilbish/hilbish.userdir/index.html index 90930d5..704fa77 100644 --- a/docs/api/hilbish/hilbish.userdir/index.html +++ b/docs/api/hilbish/hilbish.userdir/index.html @@ -1,7 +1,7 @@ Module hilbish.userDir — Hilbish

Module hilbish.userDir

user-related directories

Introduction +

Module hilbish.userDir

user-related directories

Introduction

This interface just contains properties to know about certain user directories. It is equivalent to XDG on Linux and gets the user’s preferred directories for configs and data.

Static module fields diff --git a/docs/api/hilbish/index.html b/docs/api/hilbish/index.html index b21f752..1e5d07a 100644 --- a/docs/api/hilbish/index.html +++ b/docs/api/hilbish/index.html @@ -1,7 +1,7 @@ Module hilbish — Hilbish

Module hilbish

the core Hilbish API

Introduction +

Module hilbish

the core Hilbish API

Introduction

The Hilbish module includes the core API, containing interfaces and functions which directly relate to shell functionality.

Functions

alias(cmd, orig)Sets an alias, with a name of cmd to another command.
appendPath(dir)Appends the provided dir to the command path ($PATH)
complete(scope, cb)Registers a completion handler for the specified scope.
cwd() -> stringReturns the current directory of the shell.
exec(cmd)Replaces the currently running Hilbish instance with the supplied command.
goro(fn)Puts fn in a Goroutine.
highlighter(line)Line highlighter handler.
hinter(line, pos)The command line hint handler. It gets called on every key insert to
inputMode(mode)Sets the input mode for Hilbish’s line reader.
interval(cb, time) -> @TimerRuns the cb function every specified amount of time.
multiprompt(str)Changes the text prompt when Hilbish asks for more input.
prependPath(dir)Prepends dir to $PATH.
prompt(str, typ)Changes the shell prompt to the provided string.
read(prompt) -> input (string)Read input from the user, using Hilbish’s line editor/input reader.
timeout(cb, time) -> @TimerExecuted the cb function after a period of time.
which(name) -> stringChecks if name is a valid command.
runnerMode(mode)Sets the execution/runner mode for interactive Hilbish.
run(cmd, streams)Runs cmd in Hilbish’s shell script interpreter.

Static module fields diff --git a/docs/api/hilbish/index.xml b/docs/api/hilbish/index.xml index 55b4b02..cfe2244 100644 --- a/docs/api/hilbish/index.xml +++ b/docs/api/hilbish/index.xml @@ -1,7 +1,7 @@ -Module hilbish on Hilbishhttps://rosettea.github.io/Hilbish/docs/api/hilbish/Recent content in Module hilbish on HilbishHugo -- gohugo.ioen-usModule hilbish.aliaseshttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.aliases/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.aliases/Introduction The alias interface deals with all command aliases in Hilbish. +Module hilbish on Hilbishhttps://rosettea.github.io/Hilbish/docs/api/hilbish/Recent content in Module hilbish on HilbishHugo -- gohugo.ioen-usModule hilbish.abbrhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.abbr/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.abbr/Introduction The abbr module manages Hilbish abbreviations. These are words that can be replaced with longer command line strings when entered. As an example, git push can be abbreviated to gp. When the user types gp into the command line, after hitting space or enter, it will expand to git push. Abbreviations can be used as an alternative to aliases. They are saved entirely in the history Instead of the aliased form of the same command.Module hilbish.aliaseshttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.aliases/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.aliases/Introduction The alias interface deals with all command aliases in Hilbish. Functions add(alias, cmd) This is an alias (ha) for the hilbish.alias function. delete(name) Removes an alias. list() -> table[string, string] Get a table of all aliases, with string keys as the alias and the value as the command. resolve(alias) -> string? Resolves an alias to its original command. Will thrown an error if the alias doesn’t exist. hilbish.aliases.add(alias, cmd) This is an alias (ha) for the hilbish.Module hilbish.completionhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.completion/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.completion/Introduction The completions interface deals with tab completions. Functions bins(query, ctx, fields) -> entries (table), prefix (string) Return binaries/executables based on the provided parameters. call(name, query, ctx, fields) -> completionGroups (table), prefix (string) Calls a completer function. This is mainly used to call a command completer, which will have a name files(query, ctx, fields) -> entries (table), prefix (string) Returns file matches based on the provided parameters. handler(line, pos) This function contains the general completion handler for Hilbish.Module hilbish.editorhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.editor/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.editor/Introduction The hilbish.editor interface provides functions to directly interact with the line editor in use. -Functions getLine() -> string Returns the current input line. getVimRegister(register) -> string Returns the text that is at the register. insert(text) Inserts text into the Hilbish command line. getChar() -> string Reads a keystroke from the user. This is in a format of something like Ctrl-L. setVimRegister(register, text) Sets the vim register at register to hold the passed text.Module hilbish.historyhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.history/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.history/Introduction The history interface deals with command history. This includes the ability to override functions to change the main method of saving history. +Functions deleteByAmount(amount) Deletes characters in the line by the given amount. getLine() -> string Returns the current input line. getVimRegister(register) -> string Returns the text that is at the register. insert(text) Inserts text into the Hilbish command line. getChar() -> string Reads a keystroke from the user. This is in a format of something like Ctrl-L.Module hilbish.historyhttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.history/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.history/Introduction The history interface deals with command history. This includes the ability to override functions to change the main method of saving history. Functions add(cmd) Adds a command to the history. all() -> table Retrieves all history as a table. clear() Deletes all commands from the history. get(index) Retrieves a command from the history based on the index. size() -> number Returns the amount of commands in the history. hilbish.Module hilbish.jobshttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.jobs/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.jobs/Introduction Manage interactive jobs in Hilbish via Lua. Jobs are the name of background tasks/commands. A job can be started via interactive usage or with the functions defined below for use in external runners. Functions add(cmdstr, args, execPath) Creates a new job. This function does not run the job. This function is intended to be all() -> table[@Job] Returns a table of all job objects. disown(id) Disowns a job. This simply deletes it from the list of jobs without stopping it.Module hilbish.messageshttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.messages/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.messages/Introduction The messages interface defines a way for Hilbish-integrated commands, user config and other tasks to send notifications to alert the user.z The hilbish.message type is a table with the following keys: title (string): A title for the message notification. text (string): The contents of the message. channel (string): States the origin of the message, hilbish.* is reserved for Hilbish tasks. summary (string): A short summary of the text. icon (string): Unicode (preferably standard emoji) icon for the message notification read (boolean): Whether the full message has been read or not.Module hilbish.modulehttps://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.module/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/api/hilbish/hilbish.module/Introduction The hilbish.module interface provides a function to load Hilbish plugins/modules. Hilbish modules are Go-written plugins (see https://pkg.go.dev/plugin ) that are used to add functionality to Hilbish that cannot be written in Lua for any reason. diff --git a/docs/api/index.html b/docs/api/index.html index ef040d4..180b428 100644 --- a/docs/api/index.html +++ b/docs/api/index.html @@ -1,5 +1,5 @@ API — Hilbish

API

Welcome to the API documentation for Hilbish. This documents Lua functions +

\ No newline at end of file diff --git a/docs/api/snail/index.html b/docs/api/snail/index.html index cb3da16..9079e63 100644 --- a/docs/api/snail/index.html +++ b/docs/api/snail/index.html @@ -1,7 +1,7 @@ Module snail — Hilbish

Module snail

shell script interpreter library

Introduction +

Module snail

shell script interpreter library

Introduction

The snail library houses Hilbish’s Lua wrapper of its shell script interpreter. It’s not very useful other than running shell scripts, which can be done with other Hilbish functions.

Functions diff --git a/docs/api/terminal/index.html b/docs/api/terminal/index.html index 1b49216..bb42c0b 100644 --- a/docs/api/terminal/index.html +++ b/docs/api/terminal/index.html @@ -1,7 +1,7 @@ Module terminal — Hilbish

Module terminal

low level terminal library

Introduction +

Module terminal

low level terminal library

Introduction

The terminal library is a simple and lower level library for certain terminal interactions.

Functions

restoreState()Restores the last saved state of the terminal
saveState()Saves the current state of the terminal.
setRaw()Puts the terminal into raw mode.
size()Gets the dimensions of the terminal. Returns a table with width and height

terminal.restoreState()

Restores the last saved state of the terminal

Parameters diff --git a/docs/completions/index.html b/docs/completions/index.html index a56ba0e..fa9fc6a 100644 --- a/docs/completions/index.html +++ b/docs/completions/index.html @@ -1,7 +1,7 @@ Completions — Hilbish

Completions

Tab completion for commands.

Completions for commands can be created with the hilbish.complete +

Completions

Tab completion for commands.

Completions for commands can be created with the hilbish.complete function. See the link for how to use it.

To create completions for a command is simple. The callback will be passed 3 parameters: