diff --git a/docs/bait.txt b/docs/bait.txt index c847680..9f1e54b 100644 --- a/docs/bait.txt +++ b/docs/bait.txt @@ -3,3 +3,4 @@ catch(name, cb) > Catches a hook with `name`. Runs the `cb` when it is thrown catchOnce(name, cb) > Same as catch, but only runs the `cb` once and then removes the hook throw(name, ...args) > Throws a hook with `name` with the provided `args` + diff --git a/docs/commander.txt b/docs/commander.txt index f4688b6..8b4b329 100644 --- a/docs/commander.txt +++ b/docs/commander.txt @@ -1,3 +1,4 @@ deregister(name) > Deregisters any command registered with `name` register(name, cb) > Register a command with `name` that runs `cb` when ran + diff --git a/docs/fs.txt b/docs/fs.txt index 1d9361a..648737e 100644 --- a/docs/fs.txt +++ b/docs/fs.txt @@ -5,3 +5,4 @@ mkdir(name, recursive) > Makes a directory called `name`. If `recursive` is true readdir(dir) > Returns a table of files in `dir` stat(path) > Returns info about `path` + diff --git a/docs/hilbish.txt b/docs/hilbish.txt index 2037631..6de1c18 100644 --- a/docs/hilbish.txt +++ b/docs/hilbish.txt @@ -36,3 +36,4 @@ Returns `input`, will be nil if ctrl + d is pressed, or an error occurs (which s run(cmd) > Runs `cmd` in Hilbish's sh interpreter. timeout(cb, time) > Runs the `cb` function after `time` in milliseconds + diff --git a/docs/terminal.txt b/docs/terminal.txt index 8268fe7..80af3f4 100644 --- a/docs/terminal.txt +++ b/docs/terminal.txt @@ -6,3 +6,4 @@ saveState() > Saves the current state of the terminal size() > Gets the dimensions of the terminal. Returns a table with `width` and `height` Note: this is not the size in relation to the dimensions of the display + diff --git a/emmyLuaDocs/bait.lua b/emmyLuaDocs/bait.lua new file mode 100644 index 0000000..72f9703 --- /dev/null +++ b/emmyLuaDocs/bait.lua @@ -0,0 +1,14 @@ +--- @meta + +local bait = {} + +--- Catches a hook with `name`. Runs the `cb` when it is thrown +function bait.catch() end + +--- Same as catch, but only runs the `cb` once and then removes the hook +function bait.catchOnce() end + +--- Throws a hook with `name` with the provided `args` +function bait.throw() end + +return bait diff --git a/emmyLuaDocs/commander.lua b/emmyLuaDocs/commander.lua new file mode 100644 index 0000000..cedc581 --- /dev/null +++ b/emmyLuaDocs/commander.lua @@ -0,0 +1,11 @@ +--- @meta + +local commander = {} + +--- Deregisters any command registered with `name` +function commander.deregister() end + +--- Register a command with `name` that runs `cb` when ran +function commander.register() end + +return commander diff --git a/emmyLuaDocs/fs.lua b/emmyLuaDocs/fs.lua new file mode 100644 index 0000000..e11163a --- /dev/null +++ b/emmyLuaDocs/fs.lua @@ -0,0 +1,17 @@ +--- @meta + +local fs = {} + +--- Changes directory to `dir` +function fs.cd() end + +--- Makes a directory called `name`. If `recursive` is true, it will create its parent directories. +function fs.mkdir() end + +--- Returns a table of files in `dir` +function fs.readdir() end + +--- Returns info about `path` +function fs.stat() end + +return fs diff --git a/emmyLuaDocs/hilbish.lua b/emmyLuaDocs/hilbish.lua new file mode 100644 index 0000000..ab933a9 --- /dev/null +++ b/emmyLuaDocs/hilbish.lua @@ -0,0 +1,58 @@ +--- @meta + +local hilbish = {} + +--- Sets an alias of `orig` to `cmd` +function hilbish.alias() end + +--- Appends `dir` to $PATH +function hilbish.appendPath() end + +--- Registers a completion handler for `scope`. +--- A `scope` is currently only expected to be `command.`, +--- replacing with the name of the command (for example `command.git`). +--- `cb` must be a function that returns a table of the entries to complete. +--- Nested tables will be used as sub-completions. +function hilbish.complete() end + +--- Returns the current directory of the shell +function hilbish.cwd() end + +--- Replaces running hilbish with `cmd` +function hilbish.exec() end + +--- Checks if the `f` flag has been passed to Hilbish. +function hilbish.flag() end + +--- Puts `fn` in a goroutine +function hilbish.goroutine() end + +--- Runs the `cb` function every `time` milliseconds +function hilbish.interval() end + +--- Changes the continued line prompt to `str` +function hilbish.mlprompt() end + +--- Prepends `dir` to $PATH +function hilbish.prependPath() end + +--- Changes the shell prompt to `str` +--- There are a few verbs that can be used in the prompt text. +--- These will be formatted and replaced with the appropriate values. +--- `%d` - Current working directory +--- `%u` - Name of current user +--- `%h` - Hostname of device +function hilbish.prompt() end + +--- Read input from the user, using Hilbish's line editor/input reader. +--- This is a separate instance from the one Hilbish actually uses. +--- Returns `input`, will be nil if ctrl + d is pressed, or an error occurs (which shouldn't happen) +function hilbish.read() end + +--- Runs `cmd` in Hilbish's sh interpreter. +function hilbish.run() end + +--- Runs the `cb` function after `time` in milliseconds +function hilbish.timeout() end + +return hilbish diff --git a/emmyLuaDocs/terminal.lua b/emmyLuaDocs/terminal.lua new file mode 100644 index 0000000..57073ae --- /dev/null +++ b/emmyLuaDocs/terminal.lua @@ -0,0 +1,18 @@ +--- @meta + +local terminal = {} + +--- Puts the terminal in raw mode +function terminal.raw() end + +--- Restores the last saved state of the terminal +function terminal.restoreState() end + +--- Saves the current state of the terminal +function terminal.saveState() end + +--- Gets the dimensions of the terminal. Returns a table with `width` and `height` +--- Note: this is not the size in relation to the dimensions of the display +function terminal.size() end + +return terminal