mirror of https://github.com/Hilbis/Hilbish
docs: [ci] generate new docs
parent
9e1ec1641c
commit
c55cd345ba
|
@ -21,11 +21,11 @@ Catches a hook with `name`. Runs the `cb` when it is thrown
|
||||||
### catchOnce(name, cb)
|
### catchOnce(name, cb)
|
||||||
Same as catch, but only runs the `cb` once and then removes the hook
|
Same as catch, but only runs the `cb` once and then removes the hook
|
||||||
|
|
||||||
### hooks(name) -> {}
|
### hooks(name) -> table
|
||||||
Returns a table with hooks (callback functions) on the event with `name`.
|
Returns a table with hooks (callback functions) on the event with `name`.
|
||||||
|
|
||||||
### release(name, catcher)
|
### release(name, catcher)
|
||||||
Removes the `catcher` for the event with `name`
|
Removes the `catcher` for the event with `name`.
|
||||||
For this to work, `catcher` has to be the same function used to catch
|
For this to work, `catcher` has to be the same function used to catch
|
||||||
an event, like one saved to a variable.
|
an event, like one saved to a variable.
|
||||||
|
|
||||||
|
|
|
@ -13,25 +13,25 @@ and other things, and acts an addition to the Lua standard library's
|
||||||
I/O and filesystem functions.
|
I/O and filesystem functions.
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
### abs(path)
|
### abs(path) -> string
|
||||||
Gives an absolute version of `path`.
|
Gives an absolute version of `path`.
|
||||||
|
|
||||||
### basename(path)
|
### basename(path) -> string
|
||||||
Gives the basename of `path`. For the rules,
|
Gives the basename of `path`. For the rules,
|
||||||
see Go's filepath.Base
|
see Go's filepath.Base
|
||||||
|
|
||||||
### cd(dir)
|
### cd(dir)
|
||||||
Changes directory to `dir`
|
Changes directory to `dir`
|
||||||
|
|
||||||
### dir(path)
|
### dir(path) -> string
|
||||||
Returns the directory part of `path`. For the rules, see Go's
|
Returns the directory part of `path`. For the rules, see Go's
|
||||||
filepath.Dir
|
filepath.Dir
|
||||||
|
|
||||||
### glob(pattern)
|
### glob(pattern) -> matches (table)
|
||||||
Glob all files and directories that match the pattern.
|
Glob all files and directories that match the pattern.
|
||||||
For the rules, see Go's filepath.Glob
|
For the rules, see Go's filepath.Glob
|
||||||
|
|
||||||
### join(...)
|
### join(...) -> string
|
||||||
Takes paths and joins them together with the OS's
|
Takes paths and joins them together with the OS's
|
||||||
directory separator (forward or backward slash).
|
directory separator (forward or backward slash).
|
||||||
|
|
||||||
|
|
|
@ -11,18 +11,19 @@ menu:
|
||||||
The completions interface deals with tab completions.
|
The completions interface deals with tab completions.
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
### call(name, query, ctx, fields)
|
### call(name, query, ctx, fields) -> completionGroups (table), prefix (string)
|
||||||
Calls a completer function. This is mainly used to call
|
Calls a completer function. This is mainly used to call
|
||||||
a command completer, which will have a `name` in the form
|
a command completer, which will have a `name` in the form
|
||||||
of `command.name`, example: `command.git`
|
of `command.name`, example: `command.git`.
|
||||||
|
You can check `doc completions` for info on the `completionGroups` return value.
|
||||||
|
|
||||||
### handler(line, pos)
|
### handler(line, pos)
|
||||||
The handler function is the callback for tab completion in Hilbish.
|
The handler function is the callback for tab completion in Hilbish.
|
||||||
You can check the completions doc for more info.
|
You can check the completions doc for more info.
|
||||||
|
|
||||||
### bins(query, ctx, fields)
|
### bins(query, ctx, fields) -> entries (table), prefix (string)
|
||||||
Returns binary/executale completion candidates based on the provided query.
|
Returns binary/executale completion candidates based on the provided query.
|
||||||
|
|
||||||
### files(query, ctx, fields)
|
### files(query, ctx, fields) -> entries (table), prefix (string)
|
||||||
Returns file completion candidates based on the provided query.
|
Returns file completion candidates based on the provided query.
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,10 @@ The hilbish.editor interface provides functions to
|
||||||
directly interact with the line editor in use.
|
directly interact with the line editor in use.
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
### getLine()
|
### getLine() -> string
|
||||||
Returns the current input line.
|
Returns the current input line.
|
||||||
|
|
||||||
### getVimRegister(register)
|
### getVimRegister(register) -> string
|
||||||
Returns the text that is at the register.
|
Returns the text that is at the register.
|
||||||
|
|
||||||
### insert(text)
|
### insert(text)
|
||||||
|
|
|
@ -16,12 +16,15 @@ method of saving history.
|
||||||
### add(cmd)
|
### add(cmd)
|
||||||
Adds a command to the history.
|
Adds a command to the history.
|
||||||
|
|
||||||
|
### all() -> table
|
||||||
|
Retrieves all history.
|
||||||
|
|
||||||
### clear()
|
### clear()
|
||||||
Deletes all commands from the history.
|
Deletes all commands from the history.
|
||||||
|
|
||||||
### get(idx)
|
### get(idx)
|
||||||
Retrieves a command from the history based on the `idx`.
|
Retrieves a command from the history based on the `idx`.
|
||||||
|
|
||||||
### size()
|
### size() -> number
|
||||||
Returns the amount of commands in the history.
|
Returns the amount of commands in the history.
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ function bait.catchOnce(name, cb) end
|
||||||
--- @returns table<function>
|
--- @returns table<function>
|
||||||
function bait.hooks(name) end
|
function bait.hooks(name) end
|
||||||
|
|
||||||
--- Removes the `catcher` for the event with `name`
|
--- Removes the `catcher` for the event with `name`.
|
||||||
--- For this to work, `catcher` has to be the same function used to catch
|
--- For this to work, `catcher` has to be the same function used to catch
|
||||||
--- an event, like one saved to a variable.
|
--- an event, like one saved to a variable.
|
||||||
--- @param name string
|
--- @param name string
|
||||||
|
|
|
@ -4,10 +4,12 @@ local fs = {}
|
||||||
|
|
||||||
--- Gives an absolute version of `path`.
|
--- Gives an absolute version of `path`.
|
||||||
--- @param path string
|
--- @param path string
|
||||||
|
--- @returns string
|
||||||
function fs.abs(path) end
|
function fs.abs(path) end
|
||||||
|
|
||||||
--- Gives the basename of `path`. For the rules,
|
--- Gives the basename of `path`. For the rules,
|
||||||
--- see Go's filepath.Base
|
--- see Go's filepath.Base
|
||||||
|
--- @returns string
|
||||||
function fs.basename(path) end
|
function fs.basename(path) end
|
||||||
|
|
||||||
--- Changes directory to `dir`
|
--- Changes directory to `dir`
|
||||||
|
@ -17,16 +19,19 @@ function fs.cd(dir) end
|
||||||
--- Returns the directory part of `path`. For the rules, see Go's
|
--- Returns the directory part of `path`. For the rules, see Go's
|
||||||
--- filepath.Dir
|
--- filepath.Dir
|
||||||
--- @param path string
|
--- @param path string
|
||||||
|
--- @returns string
|
||||||
function fs.dir(path) end
|
function fs.dir(path) end
|
||||||
|
|
||||||
--- Glob all files and directories that match the pattern.
|
--- Glob all files and directories that match the pattern.
|
||||||
--- For the rules, see Go's filepath.Glob
|
--- For the rules, see Go's filepath.Glob
|
||||||
--- @param pattern string
|
--- @param pattern string
|
||||||
|
--- @returns table
|
||||||
function fs.glob(pattern) end
|
function fs.glob(pattern) end
|
||||||
|
|
||||||
--- Takes paths and joins them together with the OS's
|
--- Takes paths and joins them together with the OS's
|
||||||
--- directory separator (forward or backward slash).
|
--- directory separator (forward or backward slash).
|
||||||
--- @vararg any
|
--- @vararg string
|
||||||
|
--- @returns string
|
||||||
function fs.join(...) end
|
function fs.join(...) end
|
||||||
|
|
||||||
--- Makes a directory called `name`. If `recursive` is true, it will create its parent directories.
|
--- Makes a directory called `name`. If `recursive` is true, it will create its parent directories.
|
||||||
|
|
|
@ -16,7 +16,8 @@ function hilbish.runner.setMode(cb) end
|
||||||
|
|
||||||
--- Calls a completer function. This is mainly used to call
|
--- Calls a completer function. This is mainly used to call
|
||||||
--- a command completer, which will have a `name` in the form
|
--- a command completer, which will have a `name` in the form
|
||||||
--- of `command.name`, example: `command.git`
|
--- of `command.name`, example: `command.git`.
|
||||||
|
--- You can check `doc completions` for info on the `completionGroups` return value.
|
||||||
--- @param name string
|
--- @param name string
|
||||||
--- @param query string
|
--- @param query string
|
||||||
--- @param ctx string
|
--- @param ctx string
|
||||||
|
@ -242,6 +243,10 @@ function hilbish.jobs.last() end
|
||||||
--- @param cmd string
|
--- @param cmd string
|
||||||
function hilbish.history.add(cmd) end
|
function hilbish.history.add(cmd) end
|
||||||
|
|
||||||
|
--- Retrieves all history.
|
||||||
|
--- @returns table
|
||||||
|
function hilbish.history.all() end
|
||||||
|
|
||||||
--- Deletes all commands from the history.
|
--- Deletes all commands from the history.
|
||||||
function hilbish.history.clear() end
|
function hilbish.history.clear() end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue