diff --git a/argentum.cfg b/argentum.cfg index b378c6b..4656d31 100644 --- a/argentum.cfg +++ b/argentum.cfg @@ -1,7 +1,7 @@ local agcfg = { ["halyde"] = { ["maindir"] = "", - ["version"] = "2.8.0", + ["version"] = "2.8.1", ["description"] = "A universal, customizable and feature-packed operating system for OpenComputers.", ["directories"] = { "halyde/apps", diff --git a/halyde/apps/lsdrv.lua b/halyde/apps/lsdrv.lua index c1d40a7..55133fb 100644 --- a/halyde/apps/lsdrv.lua +++ b/halyde/apps/lsdrv.lua @@ -1,3 +1,4 @@ +local serialize = import("serialize") local component = import("component") local computer = import("computer") local unicode = import("unicode") @@ -54,6 +55,11 @@ local function defaultHeaders() addHeader("label") end +local function invalidArgSyntax(err) + print(err) + return shell.run("help lsdrv") +end + local outArgIdx = table.find(args,"-o") or table.find(args,"--output") if showAll then everyHeader() @@ -169,8 +175,12 @@ local function handleComponent(id,type) bootable = formatBoolean(isBootable(proxy,type)) end - local clabel = proxy.getLabel() - label=clabel and "\""..clabel.."\"" or "None" + if proxy.getLabel then + local clabel = proxy.getLabel() + label=clabel and serialize.string(clabel) or "None" + else + label="Unsupported" + end local function insertElement(i,v) if not tablePos[i] then return end @@ -238,6 +248,7 @@ if not showAll then if showArgIdx then table.remove(args,showArgIdx) local arg = table.remove(args,showArgIdx) + if not arg then return invalidArgSyntax("Argument -s must have a value") end local func,err = luaExpr(arg) if func then filter(comps,func) @@ -255,6 +266,7 @@ local sortArgIdx = table.find(args,"-S") or table.find(args,"--sort") if sortArgIdx then table.remove(args,sortArgIdx) local arg = table.remove(args,sortArgIdx) + if not arg then return invalidArgSyntax("Argument -S must have a value") end local func,err = luaExpr(arg) if func then table.sort(comps,function(a,b) diff --git a/halyde/core/boot.lua b/halyde/core/boot.lua index f0dd029..0405c25 100644 --- a/halyde/core/boot.lua +++ b/halyde/core/boot.lua @@ -1,7 +1,7 @@ local loadfile = ... local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile) -_G._OSVERSION = "Halyde 2.8.0" +_G._OSVERSION = "Halyde 2.8.1" _G._OSLOGO = "" local handle, tmpdata = filesystem.open("/halyde/config/oslogo.ans", "r"), nil repeat