mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
统一Usage
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
@@ -9,8 +11,17 @@ namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
showError("Error: Please specify file name");
|
||||
showError("Usage: branswe <filename>");
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "<filename>",
|
||||
Description = "Execute Branswe file",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError(UsageGenerator.GenerateUsage("branswe", commandInfos));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CMLeonOS;
|
||||
|
||||
namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
@@ -9,7 +11,17 @@ namespace CMLeonOS.Commands.Script
|
||||
{
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
showError("Usage: com <filename.cm>");
|
||||
var commandInfos = new List<UsageGenerator.CommandInfo>
|
||||
{
|
||||
new UsageGenerator.CommandInfo
|
||||
{
|
||||
Command = "<filename.cm>",
|
||||
Description = "Execute command file",
|
||||
IsOptional = false
|
||||
}
|
||||
};
|
||||
|
||||
showError(UsageGenerator.GenerateUsage("com", commandInfos));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user