mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 08:52:50 +08:00

* Add "Shared" projects for all examples * Update "Colors" example with better TrueColor demo * Use same namespace for all examples
25 lines
610 B
C#
25 lines
610 B
C#
using System.Linq;
|
|
using Spectre.Console.Cli;
|
|
|
|
namespace Spectre.Console.Examples
|
|
{
|
|
public static class Program
|
|
{
|
|
public static int Main(string[] args)
|
|
{
|
|
var app = new CommandApp();
|
|
app.Configure(config =>
|
|
{
|
|
foreach(var index in Enumerable.Range(1, 10))
|
|
{
|
|
config.AddCommand<MyCommand>($"c{index}")
|
|
.WithDescription($"Prints the number {index}")
|
|
.WithData(index);
|
|
}
|
|
});
|
|
|
|
return app.Run(args);
|
|
}
|
|
}
|
|
}
|