Difference between revisions of "Shell.aliases"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "{{lowercase}} {{Function |name=shell.aliases |args=string path |api=Shell |returns=A table containing default and set aliases. If a path is specified, it will return a tab...")
 
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=shell.aliases
 
|name=shell.aliases
|args=[[string]] path
 
 
|api=Shell
 
|api=Shell
|returns=A table containing default and set aliases. If a path is specified, it will return a table in which all the contents are part of that specific api/path
+
|returns=A table containing default and set aliases.
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 
|desc=Returns a table containing the default aliases and user specified aliases
 
|desc=Returns a table containing the default aliases and user specified aliases
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=This code will define a path, 'fs', for shell.aliases to use. This wll return all functions relating to the 'fs' api
+
|desc=This code will return all set aliases
|code= for k,v in pairs(shell.aliases("fs")) do<br/>  print(v)<br/>end
+
|code= for k,v in pairs(shell.aliases()) do<br/>  print(v)<br/>end
 
}}
 
}}
 
}}
 
}}
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Revision as of 13:12, 29 March 2013


Grid Redstone.png  Function shell.aliases
Returns a table containing the default aliases and user specified aliases
Syntax shell.aliases()
Returns A table containing default and set aliases.
Part of ComputerCraft
API Shell

Examples

Grid paper.png  Example
This code will return all set aliases
Code
for k,v in pairs(shell.aliases()) do
print(v)
end