再次修复cmd的help命令错误
This commit is contained in:
@@ -216,12 +216,12 @@ do--commands.help(arg)
|
|||||||
--help or help [page]
|
--help or help [page]
|
||||||
local page=arg==""and 1 or tonumber(arg)
|
local page=arg==""and 1 or tonumber(arg)
|
||||||
if page then
|
if page then
|
||||||
if arg==int(arg)and arg>=1 and arg<=maxPage then
|
if page==int(page)and page>=1 and page<=maxPage then
|
||||||
log"Use help [page] to view more commands,"
|
log"Use help [page] to view more commands,"
|
||||||
log"or help [command_name] for details of a command."
|
log"or help [command_name] for details of a command."
|
||||||
log""
|
log""
|
||||||
log{COLOR.lPink,"Page ",COLOR.lG,arg,COLOR.lPink," of ",COLOR.lG,maxPage}
|
log{COLOR.lPink,"Page ",COLOR.lG,page,COLOR.lPink," of ",COLOR.lG,maxPage}
|
||||||
for i=pageSize*(arg-1)+1,math.min(pageSize*arg,#command_help_list)do
|
for i=pageSize*(page-1)+1,math.min(pageSize*page,#command_help_list)do
|
||||||
local cmd=command_help_list[i]
|
local cmd=command_help_list[i]
|
||||||
log{COLOR.W,cmd,COLOR.grey," "..command_help_messages[cmd].description}
|
log{COLOR.W,cmd,COLOR.grey," "..command_help_messages[cmd].description}
|
||||||
end
|
end
|
||||||
@@ -229,7 +229,7 @@ do--commands.help(arg)
|
|||||||
log{COLOR.red,"Invalid page number. Must be between 1 and "..maxPage.." (inclusive)."}
|
log{COLOR.red,"Invalid page number. Must be between 1 and "..maxPage.." (inclusive)."}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log{COLOR.red,"No cammand called "..arg}
|
log{COLOR.red,"No command called "..arg}
|
||||||
end
|
end
|
||||||
|
|
||||||
--Else
|
--Else
|
||||||
|
|||||||
Reference in New Issue
Block a user