Difference between revisions of "Shell.aliases"
From ComputerCraft Wiki
SuicidalSTDz (Talk | contribs) (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...") |
m (Actually explained what this function does.) |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=shell.aliases | |name=shell.aliases | ||
| − | |||
|api=Shell | |api=Shell | ||
| − | |returns=A table containing default and | + | |returns=A table containing default and user-specified program 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 any user-specified aliases. The key of each entry is the 'alias name', and the value the physical program. |
|examples= | |examples= | ||
{{Example | {{Example | ||
| − | |desc=This code will | + | |desc=This code will return all set aliases and the programs they refer to. |
| − | |code= for | + | |code= for alias, programName in pairs(shell.aliases()) do<br/> print(alias .. " => " .. programName)<br/>end |
| − | }} | + | |output=<pre>mv => move |
| + | dir => list | ||
| + | cp => copy | ||
| + | rm => delete | ||
| + | ls => list</pre>}} | ||
}} | }} | ||
| + | |||
[[Category:API_Functions]] | [[Category:API_Functions]] | ||
Latest revision as of 00:11, 8 July 2013
| Returns a table containing the default aliases and any user-specified aliases. The key of each entry is the 'alias name', and the value the physical program. | |
| Syntax | shell.aliases() |
| Returns | A table containing default and user-specified program aliases. |
| Part of | ComputerCraft |
| API | Shell |