Add Spectre.Cli to Spectre.Console

* Renames Spectre.Cli to Spectre.Console.Cli.
* Now uses Verify with Spectre.Console.Cli tests.
* Removes some duplicate definitions.

Closes #168
This commit is contained in:
Patrik Svensson
2020-12-23 10:41:29 +01:00
committed by Patrik Svensson
parent 0bbf9b81a9
commit 0ae419326d
361 changed files with 13934 additions and 604 deletions

View File

@ -0,0 +1,34 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
namespace Spectre.Console.Cli.Internal
{
[Description("Displays the CLI library version")]
[SuppressMessage("Performance", "CA1812: Avoid uninstantiated internal classes")]
internal sealed class VersionCommand : Command<VersionCommand.Settings>
{
private readonly IAnsiConsole _writer;
public VersionCommand(IConfiguration configuration)
{
_writer = configuration.Settings.Console.GetConsole();
}
public sealed class Settings : CommandSettings
{
}
public override int Execute([NotNull] CommandContext context, [NotNull] Settings settings)
{
_writer.MarkupLine(
"[yellow]Spectre.Cli[/] version [aqua]{0}[/]",
VersionHelper.GetVersion(typeof(VersionCommand)?.Assembly));
_writer.MarkupLine(
"[yellow]Spectre.Console[/] version [aqua]{0}[/]",
VersionHelper.GetVersion(typeof(IAnsiConsole)?.Assembly));
return 0;
}
}
}