Difference between revisions of "Shell (API)"

From ComputerCraft Wiki
Jump to: navigation, search
(added NeedsWork tag)
(shell.clearAlias only requires, and only accepts the alias to clear)
Line 38: Line 38:
 
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets an alias.</td></tr>
 
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets an alias.</td></tr>
  
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.clearAlias]]({{type|string}} alias, {{type|string}} program)</td>
+
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.clearAlias]]({{type|string}} alias)</td>
 
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Clears an alias.</td></tr>
 
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Clears an alias.</td></tr>
  

Revision as of 15:29, 29 June 2013

This page needs some serious TLC, stat!
Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: Need to add pages for the shell functions--Cranium 17:10, 10 May 2013 (MSK))

The shell API allows you to interface with the shell.

Grid disk.png   Shell (API)

Method NameDescription
shell.exit() Exits the current shell
shell.dir() Returns the directory
shell.setDir(string path) Sets the directory
shell.path() Returns the path
shell.setPath(string path) Sets the path
shell.resolve(string localpath) Resolves a local path to an absolute path.
shell.resolveProgram(string name) Resolves the absolute path to the program whose name you provided.
shell.aliases() Returns aliases.
shell.setAlias(string alias, string program) Sets an alias.
shell.clearAlias(string alias) Clears an alias.
shell.programs([boolean hidden]) Returns a table of programs.
shell.run(string program, string arguments) Runs a program.
shell.getRunningProgram() Returns the absolute path to the currently-executing program.