shell.getCompletionInfo
From ComputerCraft Wiki
Revision as of 00:34, 2 August 2015 by Bomb Bloke (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=shell.getCompletionInfo |returns={{Type|table}} completion function info |api=shell |addon=ComputerCraft |desc=Added by ComputerCraft 1.74, shel...")
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
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. |