mirror of https://github.com/Hilbis/Hilbish
docs: add docs for functions
parent
54635072f6
commit
afd999a7b0
|
@ -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`
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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`
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue