Difference between revisions of "Shell (API)"
From ComputerCraft Wiki
m (→Methods fix.) |
|||
Line 12: | Line 12: | ||
|Returns the directory | |Returns the directory | ||
|- | |- | ||
− | |[[shell.setDir]]( path ) | + | |[[shell.setDir]](path) |
|Sets the directory | |Sets the directory | ||
|- | |- | ||
Line 18: | Line 18: | ||
|Returns the path | |Returns the path | ||
|- | |- | ||
− | |[[shell.setPath]]( path ) | + | |[[shell.setPath]](path) |
|Sets the path | |Sets the path | ||
|- | |- | ||
− | |[[shell.resolve]]( localpath ) | + | |[[shell.resolve]](localpath) |
|Resolves a local path to an absolute path. | |Resolves a local path to an absolute path. | ||
|- | |- | ||
− | |[[shell.resolveProgram]]( name ) | + | |[[shell.resolveProgram]](name) |
|Resolves the absolute path to the program whose name you provided. | |Resolves the absolute path to the program whose name you provided. | ||
Line 31: | Line 31: | ||
|Returns aliases. | |Returns aliases. | ||
|- | |- | ||
− | |[[shell.setAlias]]( alias, command ) | + | |[[shell.setAlias]](alias, command) |
|Sets an alias. | |Sets an alias. | ||
|- | |- | ||
− | |[[shell.clearAlias]]( alias, command ) | + | |[[shell.clearAlias]](alias, command) |
|Clears an alias. | |Clears an alias. | ||
|- | |- | ||
Line 40: | Line 40: | ||
|Returns programs. | |Returns programs. | ||
|- | |- | ||
− | |[[shell.run]]( program, arguments ) | + | |[[shell.run]](program, arguments) |
|Runs a program. | |Runs a program. | ||
|- | |- |
Revision as of 08:45, 25 November 2012
The shell API allows you to interface with the shell.
Methods
Method name | Description |
---|---|
shell.exit() | Exits the current shell |
shell.dir() | Returns the directory |
shell.setDir(path) | Sets the directory |
shell.path() | Returns the path |
shell.setPath(path) | Sets the path |
shell.resolve(localpath) | Resolves a local path to an absolute path. |
shell.resolveProgram(name) | Resolves the absolute path to the program whose name you provided. |
shell.aliases() | Returns aliases. |
shell.setAlias(alias, command) | Sets an alias. |
shell.clearAlias(alias, command) | Clears an alias. |
shell.programs() | Returns programs. |
shell.run(program, arguments) | Runs a program. |
shell.getRunningProgram() | Returns the absolute path to the currently-executing program. |