统一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,4 +1,6 @@
using System;
using System.Collections.Generic;
using CMLeonOS;
namespace CMLeonOS.Commands.User
{
@@ -8,7 +10,17 @@ namespace CMLeonOS.Commands.User
{
if (string.IsNullOrEmpty(args))
{
showError("Usage: hostname <new_hostname>");
var commandInfos = new List<UsageGenerator.CommandInfo>
{
new UsageGenerator.CommandInfo
{
Command = "<new_hostname>",
Description = "Set new hostname",
IsOptional = false
}
};
showError(UsageGenerator.GenerateUsage("hostname", commandInfos));
return;
}