Longopt in usage message

This commit is contained in:
Shy 2024-08-22 19:45:20 +02:00
parent 2d5f17a13e
commit c7f4a01401

4
c4mate
View file

@ -10,7 +10,7 @@ USER = nil
HOST = "http://mate.labor.koeln.ccc.de" HOST = "http://mate.labor.koeln.ccc.de"
function utf8_decode(str) function utf8_decode(str)
-- Replace JSON unicode escape sequences with chars. -- Replace JSON Unicode escape sequences with chars.
if str == nil then return "" end if str == nil then return "" end
return string.gsub(str, "\\u(%x%x%x%x)", return string.gsub(str, "\\u(%x%x%x%x)",
function (s) return utf8.char(tonumber(s, 16)) end) function (s) return utf8.char(tonumber(s, 16)) end)
@ -351,7 +351,7 @@ elseif arg[1] == "-g" or
local reason = table.concat(arg, " ", 4) local reason = table.concat(arg, " ", 4)
if amount == nil or recipient == nil then if amount == nil or recipient == nil then
print("Error: could not parse amount and/or recipient.") print("Error: could not parse amount and/or recipient.")
print("Usage: c4mate -g <amount> <user> [<reason>]") print("Usage: c4mate --give <amount> <user> [<reason>]")
return return
end end