mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-07-17 09:22:53 +00:00

Unfortunately we can't apply the config changes due to backwards compatibility. This'll be something we may need to PR into Forge. CraftTweaker support still needs to be added.
27 lines
570 B
Lua
27 lines
570 B
Lua
|
|
local tArgs = { ... }
|
|
if #tArgs > 2 then
|
|
print( "Usage: alias <alias> <program>" )
|
|
return
|
|
end
|
|
|
|
local sAlias = tArgs[1]
|
|
local sProgram = tArgs[2]
|
|
|
|
if sAlias and sProgram then
|
|
-- Set alias
|
|
shell.setAlias( sAlias, sProgram )
|
|
elseif sAlias then
|
|
-- Clear alias
|
|
shell.clearAlias( sAlias )
|
|
else
|
|
-- List aliases
|
|
local tAliases = shell.aliases()
|
|
local tList = {}
|
|
for sAlias, sCommand in pairs( tAliases ) do
|
|
table.insert( tList, sAlias .. ":" .. sCommand )
|
|
end
|
|
table.sort( tList )
|
|
textutils.pagedTabulate( tList )
|
|
end
|