Shell API

From ComputerCraft
Jump to: navigation, search

Shell.aliases Shell.clearAlias Shell.complete Shell.completeProgram

FunctionFunctionshell.dir
Returns the current shell directory. Setable by shell.setDir.
Syntax shell.dir()
Returns string path
Part of CC:Tweaked
API shell
ExampleExampleGet the current shell directory.
Returns the current shell directory.
Code
shell.dir()
Output
Path of the current shell directory.

Shell.exit Shell.getCompletionInfo

FunctionFunctionshell.getRunningProgram
Returns the running program executed by shell.run.
Syntax shell.getRunningProgram()
Returns string path
Part of CC:Tweaked
API shell
ExampleExampleGet the path of a running program.
Returns the running program.
Code
shell.getRunningProgram()
Output
Running program.

Shell.openTab Shell.path Shell.programs Shell.resolve Shell.resolveProgram

,
FunctionFunctionshell.run
Runs a command in the computer's or turtle's shell.
Syntax shell.run()
Returns boolean success
Part of CC:Tweaked
API shell
ExampleExampleExecute a command in the shell
Opens the lua interface
Code
shell.run("lua")
Output
(Lua program is now running.)
ExampleExampleExecute a splitted command in the shell
Lists all files/directories in /rom
Code
shell.run("list", "/rom")
Output
All files/directories in /rom

Shell.setAlias Shell.setCompletionFunction Shell.setDir Shell.setPath Shell.switchTab