shell.getCompletionInfo

From ComputerCraft Wiki
Jump to: navigation, search


Grid Redstone.png  Function shell.getCompletionInfo
Added by ComputerCraft 1.74, shell.getCompletionInfo() returns a pointer to the table tracking completion functions set using shell.setCompletionFunction().

Within the table are keys named after the programs that've been registered. These lead to sub-tables, with "fnComplete" keys which point to the registered functions. Note that the returned pointer leads to the original table, and not a copy, meaning that manipulating it will directly affect the shell.complete() function which relies upon it.

See also: textutils.complete(), shell.complete(), shell.completeProgram(), shell.setCompletionFunction(), fs.complete() and help.completeTopic().
Syntax shell.getCompletionInfo()
Returns table completion function info
Part of ComputerCraft
API shell

Examples

Grid paper.png  Example
Returns the table containing function info for the current set of registered scripts.
Code
shell.getCompletionInfo()
Output A table formatted along these lines:
{
 ["rom/programs/help"] = { ["fnComplete"] = <function> },
 ["rom/programs/cd"]   = { ["fnComplete"] = <function> },
 ["rom/programs/gps"]  = { ["fnComplete"] = <function> },
 -- etc
}
The paths defined by default are set by the startup file in the rom directory.