订正小问题,ren命令改名mv(ren仍可用)

This commit is contained in:
MrZ626
2021-05-09 19:56:46 +08:00
parent db53da509d
commit e44964696a

View File

@@ -36,8 +36,7 @@ do--commands.help(arg)
"help", "help",
"help [command_name]", "help [command_name]",
}, },
}, },["?"]="help",
["?"]="help",
["#"]={ ["#"]={
description="Run arbitrary Lua code.", description="Run arbitrary Lua code.",
details={ details={
@@ -95,21 +94,23 @@ do--commands.help(arg)
details={ details={
"Attempt to delete a file or directory (in saving directory)", "Attempt to delete a file or directory (in saving directory)",
"", "",
"Aliases: rm", "Aliases: del rm",
"", "",
"Usage: del [filename|dirname]", "Usage: del [filename|dirname]",
"Usage: del -s [dirname]", "Usage: del -s [dirname]",
}, },
},rm="del", },rm="del",
ren={ mv={
description="Rename a file (in saving directory)", description="Rename or move a file (in saving directory)",
details={ details={
"Rename a file (in saving directory)", "Rename or move a file (in saving directory)",
{C.lY,"Warning: file name with space is not allowed"}, {C.lY,"Warning: file name with space is not allowed"},
"", "",
"Usage: ren [oldfilename] [newfilename]", "Aliases: mv ren",
"",
"Usage: mv [oldfilename] [newfilename]",
}, },
}, },ren="mv",
cls={ cls={
description="Clear the log output.", description="Clear the log output.",
details={ details={
@@ -236,7 +237,7 @@ do--commands.help(arg)
"applet -list", "applet -list",
"applet [appName]", "applet [appName]",
}, },
}, },app="applet",
}TABLE.reIndex(command_help_messages) }TABLE.reIndex(command_help_messages)
local command_help_list={ local command_help_list={
@@ -248,7 +249,7 @@ do--commands.help(arg)
"url", "url",
"tree", "tree",
"del", "del",
"ren", "mv",
"cls", "cls",
"rst", "rst",
"fn", "fn",
@@ -410,7 +411,7 @@ do--function commands.del(name)
end end
commands.rm=commands.del commands.rm=commands.del
end end
function commands.ren(arg) function commands.mv(arg)
--Check arguments --Check arguments
arg=STRING.split(arg," ") arg=STRING.split(arg," ")
if #arg>2 then if #arg>2 then
@@ -441,6 +442,8 @@ function commands.ren(arg)
log{C.Y,("Succesfully renamed file '%s' to '%s'"):format(arg[1],arg[2])} log{C.Y,("Succesfully renamed file '%s' to '%s'"):format(arg[1],arg[2])}
end end
commands.ren=commands.mv
commands.exit=backScene commands.exit=backScene
commands.quit=backScene commands.quit=backScene
commands.bye=backScene commands.bye=backScene
@@ -770,8 +773,8 @@ function scene.keyDown(k)
inputBox.value=res[1] inputBox.value=res[1]
end end
end end
elseif k=="scrollup"then outputBox:scroll(-1) elseif k=="scrollup"then outputBox:scroll(-5)
elseif k=="scrolldown"then outputBox:scroll(1) elseif k=="scrolldown"then outputBox:scroll(5)
elseif k=="pageup"then outputBox:scroll(-20) elseif k=="pageup"then outputBox:scroll(-20)
elseif k=="pagedown"then outputBox:scroll(20) elseif k=="pagedown"then outputBox:scroll(20)
elseif k=="home"then outputBox:scroll(-1e99) elseif k=="home"then outputBox:scroll(-1e99)