Commit 53dd4e5b authored by shrabbit's avatar shrabbit
Browse files

Add version command and improve welcome message display

parent 0f8054a1
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
using Spectre.Console;
using System.Reflection;
using Spectre.Console;

namespace TestV;

@@ -50,8 +51,13 @@ public class PlaygroundLauncher(Action onReload)
    /// </summary>
    private void DrawWelcome()
    {

        var figlet = new FigletText("TestV").Centered();

        AnsiConsole.Write(figlet);
        
        AnsiConsole.Write(
            new Text("欢迎来到 TestV Playground\n",
            new Text("TestV Playground 由 shRabbit 制作",
                    new Style(null, null, Decoration.Bold))
                .Centered());
        
@@ -84,6 +90,11 @@ public class PlaygroundLauncher(Action onReload)
                    WriteHelp();
                    break;
                
                case "version":
                case "ver":
                    AnsiConsole.WriteLine(Assembly.GetExecutingAssembly().GetName().Version!.ToString());
                        break;
                
                case "cls":
                    AnsiConsole.Clear();
                    break;
@@ -214,13 +225,14 @@ public class PlaygroundLauncher(Action onReload)
    /// </summary>
    private void WriteHelp()
    {
        AnsiConsole.WriteLine("\n命令帮助:");
        AnsiConsole.WriteLine("\n内置命令帮助:");
        AnsiConsole.MarkupLine("[yellow][[Command]] <Args>[/]: 运行 Playground");
        AnsiConsole.MarkupLine("[yellow]desc [[Command]][/]: 打印所选 Playground 的描述");
        AnsiConsole.MarkupLine("[yellow]name [[Command]][/]: 打印所选 Playground 的名称");
        AnsiConsole.MarkupLine("[yellow]cls [[Command]][/]: 进行清屏");
        AnsiConsole.MarkupLine("[yellow]cls[/]: 进行清屏");
        AnsiConsole.MarkupLine("[yellow]reload [[Command]][/]: 重载 Playground 实例");
        AnsiConsole.MarkupLine("[yellow]info [[Command]][/]: 打印所选 Playground 的所有信息表格");
        AnsiConsole.MarkupLine("[yellow]ver[/]: 打印 TestV 版本");
        AnsiConsole.MarkupLine("[yellow]list[/]: 列举所有 Playground\n");
    }

+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("TestV")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d0ae5dc15446b302aa2222ea918a155f3073e82f")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0f8054a1f96a9da20cee54fc699740b492aff738")]
[assembly: System.Reflection.AssemblyProductAttribute("TestV")]
[assembly: System.Reflection.AssemblyTitleAttribute("TestV")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]