|
|
@ -22,17 +22,17 @@ function parse_commandline(...)
|
|
|
|
local args, opts = {...}, {}
|
|
|
|
local args, opts = {...}, {}
|
|
|
|
local positionals = process_args(opts, args)
|
|
|
|
local positionals = process_args(opts, args)
|
|
|
|
|
|
|
|
|
|
|
|
if opts.help then
|
|
|
|
if opts.help or not positionals then
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local command = table.remove(positionals, 1)
|
|
|
|
local command = table.remove(positionals, 1)
|
|
|
|
if not command or command == 'status' then
|
|
|
|
if not command or command == 'status' then
|
|
|
|
status()
|
|
|
|
status()
|
|
|
|
elseif command == 'factor' then
|
|
|
|
|
|
|
|
misery_setFactor(positionals[1])
|
|
|
|
|
|
|
|
elseif command == 'clear' then
|
|
|
|
elseif command == 'clear' then
|
|
|
|
misery_clear()
|
|
|
|
misery_clear()
|
|
|
|
|
|
|
|
elseif tonumber(command) then
|
|
|
|
|
|
|
|
misery_setFactor(tonumber(command))
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|