feat: add version string to startup and status menu
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using Spectre.Console;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
namespace AnchorCli.Commands;
|
||||
|
||||
public class HelpCommand : ICommand
|
||||
@@ -16,6 +16,8 @@ public class HelpCommand : ICommand
|
||||
|
||||
public Task ExecuteAsync(string[] args, CancellationToken ct)
|
||||
{
|
||||
var version = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "unknown";
|
||||
AnsiConsole.MarkupLine($"[cyan]Anchor CLI v{version}[/]");
|
||||
AnsiConsole.MarkupLine("[cyan]Available commands:[/]");
|
||||
|
||||
var table = new Table();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Spectre.Console;
|
||||
using System.Reflection;
|
||||
namespace AnchorCli.Commands;
|
||||
|
||||
public class StatusCommand : ICommand
|
||||
@@ -25,6 +26,7 @@ public class StatusCommand : ICommand
|
||||
|
||||
table.AddRow("[grey]Model[/]", $"[cyan]{Markup.Escape(_model)}[/]");
|
||||
table.AddRow("[grey]Endpoint[/]", $"[blue]{Markup.Escape(_endpoint)}[/]");
|
||||
table.AddRow("[grey]Version[/]", $"[magenta]{Assembly.GetExecutingAssembly().GetName().Version}[/]");
|
||||
table.AddRow("[grey]CWD[/]", $"[green]{Markup.Escape(Environment.CurrentDirectory)}[/]");
|
||||
|
||||
AnsiConsole.Write(table);
|
||||
|
||||
Reference in New Issue
Block a user