mirror of https://github.com/Hilbis/Hilbish
deploy: 61914f8dc7
parent
805450c744
commit
f309fb3487
|
@ -14,13 +14,11 @@ that works with Hilbish for writing commands. Example:</p><div class=highlight><
|
|||
</span></span><span style=display:flex><span><span style=color:#66d9ef>end</span>)
|
||||
</span></span></code></pre></div><p>In this example, a command with the name of <code>hello</code> is created
|
||||
that will print <code>Hello world!</code> to output. One question you may
|
||||
have is: What is the <code>sinks</code> parameter?</p><p>A sink is a writable/readable pipe, or you can imagine a Lua
|
||||
file. It’s used in this case to write to the proper output,
|
||||
incase a user either pipes to another command or redirects somewhere else.</p><p>So, the <code>sinks</code> parameter is a table containing 3 sinks:
|
||||
<code>in</code>, <code>out</code>, and <code>err</code>.</p><ul><li><code>in</code> is the standard input. You can read from this sink
|
||||
have is: What is the <code>sinks</code> parameter?</p><p>The <code>sinks</code> parameter is a table with 3 keys: <code>in</code>, <code>out</code>,
|
||||
and <code>err</code>. The values of these is a <a href=/Hilbish/docs/api/hilbish/#sink style=text-decoration:none>Sink</a>.</p><ul><li><code>in</code> is the standard input. You can read from this sink
|
||||
to get user input. (<strong>This is currently unimplemented.</strong>)</li><li><code>out</code> is standard output. This is usually where text meant for
|
||||
output should go.</li><li><code>err</code> is standard error. This sink is for writing errors, as the
|
||||
name would suggest.</li></ul><p>A sink has 2 methods:</p><ul><li><code>write(str)</code> will write to the sink.</li><li><code>writeln(str)</code> will write to the sink with a newline at the end.</li></ul><h3 id=functions class=heading>Functions
|
||||
name would suggest.</li></ul><h3 id=functions class=heading>Functions
|
||||
<a href=#functions class=heading-link><i class="fas fa-paperclip"></i></a></h3><h4 id=deregistername class=heading>deregister(name)
|
||||
<a href=#deregistername class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Deregisters any command registered with <code>name</code></p><h4 id=registername-cb class=heading>register(name, cb)
|
||||
<a href=#registername-cb class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Register a command with <code>name</code> that runs <code>cb</code> when ran</p></div><div class="footer mt-auto"><p class="card-small text-muted">Want to help improve this page? <a href=https://github.com/Rosettea/Hilbish/issues/new/choose>Create an issue.</a></p></div></div></div><footer class="footer mt-auto mt-auto py-3 bg-light row"><div class="col mb-3"></div><div class="col mb-3"><a href=/Hilbish class="d-flex align-items-center mb-3 link-dark text-decoration-none"><img src=/Hilbish/hilbish-flower.png alt height=48 class="d-inline-block align-text-top"></a><p class=text-muted>Rosettea © 2022<br>Made with <i class="fa-solid fa-heart" style=color:#f6345b></i></p></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"><h5>Hilbish</h5><ul class="nav flex-column"><li class="nav-item mb-2"><a href=/Hilbish class="nav-link p-0 text-muted">Home</a></li><li class="nav-item mb-2"><a href=/Hilbish/docs/faq class="nav-link p-0 text-muted">FAQ</a></li><li class="nav-item mb-2"><a href=https://github.com/Rosettea/Hilbish class="nav-link p-0 text-muted">Source</a></li><li class="nav-item mb-2"><a href=https://github.com/Rosettea/Hilbish/releases class="nav-link p-0 text-muted">Releases</a></li><li class="nav-item mb-2"><a href=/Hilbish/docs class="nav-link p-0 text-muted">Documentation</a></li></ul></div><div class="col mb-3"></div></footer></body></html>
|
|
@ -51,4 +51,10 @@ will call it to execute user input instead.</p><h4 id=timeoutcb-time---a-hrefhil
|
|||
<a href=#timeoutcb-time---a-hrefhilbishdocsapihilbishhilbishtimerstimer-styletext-decoration-nonetimera class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Runs the <code>cb</code> function after <code>time</code> in milliseconds.
|
||||
This creates a timer that starts immediately.</p><h4 id=whichname---string class=heading>which(name) -> string
|
||||
<a href=#whichname---string class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Checks if <code>name</code> is a valid command.
|
||||
Will return the path of the binary, or a basename if it’s a commander.</p></div><div class="footer mt-auto"><p class="card-small text-muted">Want to help improve this page? <a href=https://github.com/Rosettea/Hilbish/issues/new/choose>Create an issue.</a></p></div></div></div><footer class="footer mt-auto mt-auto py-3 bg-light row"><div class="col mb-3"></div><div class="col mb-3"><a href=/Hilbish class="d-flex align-items-center mb-3 link-dark text-decoration-none"><img src=/Hilbish/hilbish-flower.png alt height=48 class="d-inline-block align-text-top"></a><p class=text-muted>Rosettea © 2022<br>Made with <i class="fa-solid fa-heart" style=color:#f6345b></i></p></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"><h5>Hilbish</h5><ul class="nav flex-column"><li class="nav-item mb-2"><a href=/Hilbish class="nav-link p-0 text-muted">Home</a></li><li class="nav-item mb-2"><a href=/Hilbish/docs/faq class="nav-link p-0 text-muted">FAQ</a></li><li class="nav-item mb-2"><a href=https://github.com/Rosettea/Hilbish class="nav-link p-0 text-muted">Source</a></li><li class="nav-item mb-2"><a href=https://github.com/Rosettea/Hilbish/releases class="nav-link p-0 text-muted">Releases</a></li><li class="nav-item mb-2"><a href=/Hilbish/docs class="nav-link p-0 text-muted">Documentation</a></li></ul></div><div class="col mb-3"></div></footer></body></html>
|
||||
Will return the path of the binary, or a basename if it’s a commander.</p><h3 id=types class=heading>Types
|
||||
<a href=#types class=heading-link><i class="fas fa-paperclip"></i></a></h3><h3 id=sink class=heading>Sink
|
||||
<a href=#sink class=heading-link><i class="fas fa-paperclip"></i></a></h3><p>A sink is a structure that has input and/or output to/from
|
||||
a desination.</p><h4 id=methods class=heading>Methods
|
||||
<a href=#methods class=heading-link><i class="fas fa-paperclip"></i></a></h4><h5 id=writestr class=heading>write(str)
|
||||
<a href=#writestr class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>Writes data to a sink.</p><h5 id=writelnstr class=heading>writeln(str)
|
||||
<a href=#writelnstr class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>Writes data to a sink with a newline at the end.</p></div><div class="footer mt-auto"><p class="card-small text-muted">Want to help improve this page? <a href=https://github.com/Rosettea/Hilbish/issues/new/choose>Create an issue.</a></p></div></div></div><footer class="footer mt-auto mt-auto py-3 bg-light row"><div class="col mb-3"></div><div class="col mb-3"><a href=/Hilbish class="d-flex align-items-center mb-3 link-dark text-decoration-none"><img src=/Hilbish/hilbish-flower.png alt height=48 class="d-inline-block align-text-top"></a><p class=text-muted>Rosettea © 2022<br>Made with <i class="fa-solid fa-heart" style=color:#f6345b></i></p></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"><h5>Hilbish</h5><ul class="nav flex-column"><li class="nav-item mb-2"><a href=/Hilbish class="nav-link p-0 text-muted">Home</a></li><li class="nav-item mb-2"><a href=/Hilbish/docs/faq class="nav-link p-0 text-muted">FAQ</a></li><li class="nav-item mb-2"><a href=https://github.com/Rosettea/Hilbish class="nav-link p-0 text-muted">Source</a></li><li class="nav-item mb-2"><a href=https://github.com/Rosettea/Hilbish/releases class="nav-link p-0 text-muted">Releases</a></li><li class="nav-item mb-2"><a href=/Hilbish/docs class="nav-link p-0 text-muted">Documentation</a></li></ul></div><div class="col mb-3"></div></footer></body></html>
|
Loading…
Reference in New Issue