From afd999a7b0c526cf8cfb683979602b399426839b Mon Sep 17 00:00:00 2001 From: sammyette <38820196+TorchedSammy@users.noreply.github.com> Date: Sat, 16 Oct 2021 15:38:49 -0400 Subject: [PATCH] docs: add docs for functions --- docs/bait.txt | 4 ++++ docs/commander.txt | 4 ++++ docs/fs.txt | 8 ++++++++ docs/global.txt | 21 +++++++++++++++++++++ docs/hilbish.txt | 6 ++++++ 5 files changed, 43 insertions(+) create mode 100644 docs/bait.txt create mode 100644 docs/commander.txt create mode 100644 docs/fs.txt create mode 100644 docs/global.txt create mode 100644 docs/hilbish.txt diff --git a/docs/bait.txt b/docs/bait.txt new file mode 100644 index 0000000..a0948b8 --- /dev/null +++ b/docs/bait.txt @@ -0,0 +1,4 @@ +catch(name, cb) > Catches a hook with `name`. Runs the `cb` when it is thrown + +throw(name, ...args) > Throws a hook with `name` with the provided `args` + diff --git a/docs/commander.txt b/docs/commander.txt new file mode 100644 index 0000000..8b4b329 --- /dev/null +++ b/docs/commander.txt @@ -0,0 +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 new file mode 100644 index 0000000..648737e --- /dev/null +++ b/docs/fs.txt @@ -0,0 +1,8 @@ +cd(dir) > Changes directory to `dir` + +mkdir(name, recursive) > Makes a directory called `name`. If `recursive` is true, it will create its parent directories. + +readdir(dir) > Returns a table of files in `dir` + +stat(path) > Returns info about `path` + diff --git a/docs/global.txt b/docs/global.txt new file mode 100644 index 0000000..6f1038e --- /dev/null +++ b/docs/global.txt @@ -0,0 +1,21 @@ +alias(cmd, orig) > Sets an alias of `orig` to `cmd` + +appendPath(dir) > Appends `dir` to $PATH + +exec(cmd) > Replaces running hilbish with `cmd` + +goro(fn) > Puts `fn` in a goroutine + +interval(cb, time) > Runs the `cb` function every `time` milliseconds + +multiprompt(str) > Changes the continued line prompt to `str` + + prompt(str) > 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 + +timeout(cb, time) > Runs the `cb` function after `time` in milliseconds + diff --git a/docs/hilbish.txt b/docs/hilbish.txt new file mode 100644 index 0000000..e04e975 --- /dev/null +++ b/docs/hilbish.txt @@ -0,0 +1,6 @@ +cwd() > Returns the current directory of the shell + +flag(f) > Checks if the `f` flag has been passed to Hilbish. + +run(cmd) > Runs `cmd` in Hilbish's sh interpreter +