Skip to content

Commit 5641843

Browse files
committed
feat(cli): improve error handling and error msgs
1 parent 885439e commit 5641843

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lsblk.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ local function main()
278278
elseif arg[1] == "-V" or arg[1] == "--version" then
279279
print(VERSION)
280280
os.exit(0)
281-
else
282-
print("unknown argument: " .. arg[1])
281+
elseif arg[1]:match("^-") then
282+
print(("lsblk: unrecognized option %q"):format(arg[1]))
283283
os.exit(2)
284284
end
285285
end
286-
if #arg >= 2 then
287-
print("too many arguments")
286+
if #arg >= 1 then
287+
print("lsblk: too many arguments")
288288
os.exit(2)
289289
end
290290

0 commit comments

Comments
 (0)