Patrik Svensson 0ae419326d 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
2020-12-28 17:28:03 +01:00

21 lines
453 B
C#

using System;
using Spectre.Console.Cli;
namespace Dynamic
{
public sealed class MyCommand : Command
{
public override int Execute(CommandContext context)
{
if (!(context.Data is int data))
{
throw new InvalidOperationException("Command has no associated data.");
}
Console.WriteLine("Value = {0}", data);
return 0;
}
}
}