<ahref=#introductionclass=heading-link><iclass="fas fa-paperclip"></i></a></h3><p>Manage interactive jobs in Hilbish via Lua.</p><p>Jobs are the name of background tasks/commands. A job can be started via
interactive usage or with the functions defined below for use in external runners.</p><h3id=functionsclass=heading>Functions
<ahref=#functionsclass=heading-link><iclass="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><ahref=#jobs.add>add(cmdstr, args, execPath)</a></td><td>Creates a new job. This function does not run the job. This function is intended to be</td></tr><tr><td><ahref=#jobs.all>all() -> table[@Job]</a></td><td>Returns a table of all job objects.</td></tr><tr><td><ahref=#jobs.disown>disown(id)</a></td><td>Disowns a job. This simply deletes it from the list of jobs without stopping it.</td></tr><tr><td><ahref=#jobs.get>get(id) -> @Job</a></td><td>Get a job object via its ID.</td></tr><tr><td><ahref=#jobs.last>last() -> @Job</a></td><td>Returns the last added job to the table.</td></tr></tbody></table><hr><divid=jobs.add><h4class=heading>hilbish.jobs.add(cmdstr, args, execPath)
<ahref=#jobs.addclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Creates a new job. This function does not run the job. This function is intended to be<br>used by runners, but can also be used to create jobs via Lua. Commanders cannot be ran as jobs.</p><h5id=parametersclass=heading>Parameters
<ahref=#parametersclass=heading-link><iclass="fas fa-paperclip"></i></a></h5><p><code>string</code><strong><code>cmdstr</code></strong><br>String that a user would write for the job</p><p><code>table</code><strong><code>args</code></strong><br>Arguments for the commands. Has to include the name of the command.</p><p><code>string</code><strong><code>execPath</code></strong><br>Binary to use to run the command. Needs to be an absolute path.</p><h5id=exampleclass=heading>Example
<ahref=#jobs.allclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Returns a table of all job objects.</p><h5id=parameters-1class=heading>Parameters
<ahref=#parameters-1class=heading-link><iclass="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><hr><divid=jobs.disown><h4class=heading>hilbish.jobs.disown(id)
<ahref=#jobs.disownclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Disowns a job. This simply deletes it from the list of jobs without stopping it.</p><h5id=parameters-2class=heading>Parameters
<ahref=#jobs.getclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Get a job object via its ID.</p><h5id=parameters-3class=heading>Parameters
<ahref=#parameters-3class=heading-link><iclass="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><hr><divid=jobs.last><h4class=heading>hilbish.jobs.last() -> <ahref=/Hilbish/docs/api/hilbish/hilbish.jobs/#jobstyle=text-decoration:noneid=lol>Job</a>
<ahref=#jobs.lastclass=heading-link><iclass="fas fa-paperclip"></i></a></h4><p>Returns the last added job to the table.</p><h5id=parameters-4class=heading>Parameters
<ahref=#parameters-4class=heading-link><iclass="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><h3id=typesclass=heading>Types
<ahref=#jobclass=heading-link><iclass="fas fa-paperclip"></i></a></h3><p>The Job type describes a Hilbish job.</p><h3id=object-propertiesclass=heading>Object properties
<ahref=#object-propertiesclass=heading-link><iclass="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>cmd</td><td>The user entered command string for the job.</td></tr><tr><td>running</td><td>Whether the job is running or not.</td></tr><tr><td>id</td><td>The ID of the job in the job table</td></tr><tr><td>pid</td><td>The Process ID</td></tr><tr><td>exitCode</td><td>The last exit code of the job.</td></tr><tr><td>stdout</td><td>The standard output of the job. This just means the normal logs of the process.</td></tr><tr><td>stderr</td><td>The standard error stream of the process. This (usually) includes error messages of the job.</td></tr></tbody></table><h4id=methodsclass=heading>Methods
<ahref=#backgroundclass=heading-link><iclass="fas fa-paperclip"></i></a></h5><p>Puts a job in the background. This acts the same as initially running a job.</p><h5id=foregroundclass=heading>foreground()
<ahref=#foregroundclass=heading-link><iclass="fas fa-paperclip"></i></a></h5><p>Puts a job in the foreground. This will cause it to run like it was
executed normally and wait for it to complete.</p><h5id=startclass=heading>start()
<ahref=#startclass=heading-link><iclass="fas fa-paperclip"></i></a></h5><p>Starts running the job.</p><h5id=stopclass=heading>stop()