From d2681152f0d5975d18133c898255560d45a56ad4 Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Sun, 20 Sep 2026 14:39:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=B8=BB=E7=BA=BF=E5=BE=85=E5=90=88?= =?UTF-8?q?=E3=80=91=E5=A2=9E=E5=8A=A0tail=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/lua.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lua.c b/lua/lua.c index 97f2977..a418265 100644 --- a/lua/lua.c +++ b/lua/lua.c @@ -485,8 +485,8 @@ static int l_cat(lua_State *L) static int l_tail(lua_State *L) { - const char *path = luaL_optstring(L, 1, "C:rd.log"); - long n = luaL_optinteger(L, 2, 15); + long n = luaL_optinteger(L, 1, 15); + const char *path = luaL_optstring(L, 2, "C:rd.log"); long start_off = 0; /* 实际输出的起始偏移 */ long lines = 0; /* 文件总行数 */ @@ -667,7 +667,7 @@ static int luaopen_default(lua_State *L) lua_register_help(L, "name", l_name, "Show build time"); lua_register_help(L, "echo", l_echo, "eg: echo(\"Hello\", \"C:a.txt\")"); lua_register_help(L, "cat", l_cat, "eg: cat(\"C:a.txt\")"); - lua_register_help(L, "tail", l_tail, "eg: tail(\"C:rd.log\") tail(\"C:rd.log\", 30)"); + lua_register_help(L, "tail", l_tail, "eg: tail(30) tail(30, \"C:rd.log\")"); lua_register_help(L, "mv", l_mv, "eg: mv(\"C:a.txt\", \"C:b.txt\")"); lua_register_help(L, "rm", l_rm, "eg: rm(\"C:a.txt\")"); lua_register_help(L, "ls", l_ls, "eg: ls()");