This commit is contained in:
commit
b54acec2f2
66 changed files with 5135 additions and 0 deletions
44
src/Process.Tests.Dummy/Program.cs
Normal file
44
src/Process.Tests.Dummy/Program.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Geekeey.Extensions.Process.Tests.Dummy.Commands;
|
||||
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Geekeey.Extensions.Process.Tests.Dummy;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
private static readonly string? FileExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "exe" : null;
|
||||
|
||||
#pragma warning disable IL3000 // only for testing where we don't run in single files!
|
||||
private static readonly string AssemblyPath = Assembly.GetExecutingAssembly().Location;
|
||||
#pragma warning restore IL3000
|
||||
|
||||
public static string FilePath { get; } = Path.ChangeExtension(AssemblyPath, FileExtension);
|
||||
|
||||
private static Task<int> Main(string[] args)
|
||||
{
|
||||
Environment.SetEnvironmentVariable("DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION", "false");
|
||||
var app = new CommandApp();
|
||||
app.Configure(Configuration);
|
||||
return app.RunAsync(args);
|
||||
|
||||
void Configuration(IConfigurator configuration)
|
||||
{
|
||||
configuration.AddCommand<EchoCommand>("echo");
|
||||
configuration.AddCommand<EchoStdinCommand>("echo-stdin");
|
||||
configuration.AddCommand<EnvironmentCommand>("env");
|
||||
configuration.AddCommand<WorkingDirectoryCommand>("cwd");
|
||||
configuration.AddCommand<WorkingDirectoryCommand>("cwd");
|
||||
configuration.AddCommand<ExitCommand>("exit");
|
||||
configuration.AddCommand<LengthCommand>("length");
|
||||
configuration.AddCommand<SleepCommand>("sleep");
|
||||
configuration.AddBranch("generate", static generate =>
|
||||
{
|
||||
generate.AddCommand<GenerateBlobCommand>("blob");
|
||||
generate.AddCommand<GenerateClobCommand>("clob");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue