feat(cube): improve ls
This commit is contained in:
parent
88ce07859d
commit
cd55d26f4e
@ -38,7 +38,7 @@ for _, filePath in pairs(LIST_FILES) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
print()
|
print()
|
||||||
print('=> Execute startup.lua')
|
print('=> Execute startup/servers.lua')
|
||||||
shell.execute('/startup.lua')
|
shell.execute('/startup/servers.lua')
|
||||||
|
|
||||||
shell.setDir(previousDir)
|
shell.setDir(previousDir)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
local _VERSION = '1.2.0';
|
local _VERSION = '1.3.0';
|
||||||
local CUBE_CHANNEL = 64;
|
local CUBE_CHANNEL = 64;
|
||||||
|
|
||||||
local net = require('/apis/net')();
|
local net = require('/apis/net')();
|
||||||
@ -29,8 +29,11 @@ local rightPad = function(str, len, char)
|
|||||||
return str;
|
return str;
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getRow(str1, str2, str3)
|
local function getRow(margin, str1, str2, str3)
|
||||||
local row1 = leftPad(tostring(str1 or ''), 6, ' ')
|
|
||||||
|
margin = margin or '';
|
||||||
|
|
||||||
|
local row1 = leftPad(margin .. tostring(str1 or ''), 8, ' ')
|
||||||
local row2 = leftPad(tostring(str2 or ''), 16, ' ')
|
local row2 = leftPad(tostring(str2 or ''), 16, ' ')
|
||||||
local row3 = leftPad(tostring(str3 or ''), 6, ' ')
|
local row3 = leftPad(tostring(str3 or ''), 6, ' ')
|
||||||
|
|
||||||
@ -171,23 +174,14 @@ local COMMANDS = {
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- print('ID LABEL\t\t\t\tSTARTUP');
|
-- print('ID LABEL\t\t\t\tSTARTUP');
|
||||||
print(getRow('ID', 'LABEL', 'STARTUP'))
|
print(getRow(' ', 'ID', 'LABEL', 'STARTUP'))
|
||||||
|
print('--------------------------------------------')
|
||||||
|
|
||||||
for k in ipairs(results) do
|
for k in ipairs(results) do
|
||||||
local result = results[k];
|
local result = results[k];
|
||||||
local packet = packets[k];
|
local packet = packets[k];
|
||||||
|
|
||||||
|
print(getRow(' ', packet.sourceId, packet.sourceLabel, result.startup))
|
||||||
-- local row1 = leftPad(tostring(packet.sourceId or ''), 8, ' ')
|
|
||||||
-- local row2 = leftPad(tostring(packet.sourceLabel or ''), 12, ' ')
|
|
||||||
-- local row3 = leftPad(tostring(result.startup or ''), 12, ' ')
|
|
||||||
-- print(packet.sourceId, packet.sourceLabel or '', result.startup)
|
|
||||||
print(getRow(packet.sourceId, packet.sourceLabel, result.startup))
|
|
||||||
-- print("=> " .. tostring(packet.sourceId)
|
|
||||||
-- ..
|
|
||||||
-- (
|
|
||||||
-- packet.sourceLabel and " (label=" .. tostring(packet.sourceLabel) .. ")" or
|
|
||||||
-- "") .. ": startup='" .. result.startup .. "'");
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
configure = function()
|
configure = function()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user