/// <summary> /// 执行命令。 /// </summary> /// <param name="context">命令执行上下文。</param> public override void Execute(CommandExecuteContext context) { var command = _commandService.GetCommand(FindName); context.Write(Environment.NewLine); if (command == null) { context.WriteLine("找不到名称为 \"{0}\",的命令。", FindName); } else { context.WriteLine("下面是命令 '{0}' 的帮助信息。", FindName); context.WriteLine(command.GetUsage()); } }