统一Usage

This commit is contained in:
2026-02-08 01:22:08 +08:00
parent 85fa99f7bd
commit 4abc6e96cf
10 changed files with 471 additions and 31 deletions

View File

@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using UniLua;
using CMLeonOS;
namespace CMLeonOS.Commands.Script
{
@@ -12,8 +14,23 @@ namespace CMLeonOS.Commands.Script
if (parts.Length == 0)
{
showError("Error: Please specify Lua script file or use --shell for interactive mode");
showError("Usage: lua <file> or lua --shell");
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "<file>",
Description = "Execute Lua script file",
IsOptional = false
},
new UsageGenerator.CommandInfo
{
Command = "--shell",
Description = "Enter Lua interactive shell",
IsOptional = false
}
};
showError(UsageGenerator.GenerateUsage("lua", commandInfos));
return;
}