static async Task Main(string[] args) { await CoconaApp.RunAsync <Program>(args, options => { options.EnableShellCompletionSupport = false; options.TreatPublicMethodsAsCommands = false; }); }
internal static CoconaApp RegisterFileCommands(this CoconaApp app) { app.AddSubCommand("clean", command => { command.AddCommand("html", ( [FromService] IFileHandlingService fileHandlingService) => { fileHandlingService.DeleteHtmlAllFiles(); })
static async Task Main(string[] args) { await CoconaApp.Create() .ConfigureServices(services => { services.AddSingleton <ICoconaValueConverter, JsonValueConverter>(); }) .RunAsync <Program>(args); }
private static async Task Main(string[] args) { await CoconaApp.Create().ConfigureServices( services => { services.AddTransient <IFileConfigurationService <RocksDbServiceConfiguration>, RocksDbServiceFileConfigurationService>(); services.AddTransient <IRocksDbService, RocksDbService>(); services.AddTransient <IInputOutputErrorContainer, StandardInputOutputErrorContainer>(); }).RunAsync <RocksDbCommand>(args); }
static void Main(string[] args) { System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); CoconaApp.Create() .ConfigureServices(services => { services.AddTransient <PMDCompileTestService>(); }) .Run <Program>(args); }
static void Main(string[] args) { CoconaApp.Create() .ConfigureServices((hostContext, services) => { services.Configure <ConnectionStringOptions>(hostContext.Configuration); services.AddTransient <IChangeSetRepository, ChangeSetAzureStorageRepository>(); services.AddTransient <IStatusRawDataRepository, StatusRawDataAzureStorageRepository>(); services.AddTransient <DataUpdateAgent>(); }) .Run <Program>(args); }
static void Main(string[] args) { CoconaApp.Create() .ConfigureLogging(logging => { logging.AddDebug(); }) .ConfigureServices(services => { services.AddTransient <MyService>(); }) .Run <Program>(args); }
public static int Main(string[] args) { var app = CoconaApp.Create(args, options => { options.TreatPublicMethodsAsCommands = true; options.EnableShellCompletionSupport = true; }); app.AddCommands <CommandLineCommands>(); app.Run(); var services = new ServiceCollection(); ConfigureServices(services); var serviceProvider = services .AddSingleton <CyCompiler, CyCompiler>() .BuildServiceProvider(); var result = serviceProvider.GetService <CyCompiler>().Compile(); return(result); }
internal static CoconaApp RegisterUploadCommands(this CoconaApp app) { app.AddSubCommand("upload", command => { command.AddCommand("report", ( [FromService] IUploadService uploadService, [Option('d', Description = "The day which should be uploaded (format: yyyyMMdd). Default is today.")] string?day, [Option('k', Description = "Uploads all log, but only prints the links to logs that killed the boss.")] bool killOnly, [Option('f', Description = "Only uses the logs that are in the list of boss ids (in the config.json file) for the printing links.")] bool filter ) => { uploadService.UploadFilesToDpsReport(day, killOnly, filter); })
static async Task Main(string[] args) { var builder = CoconaApp .CreateHostBuilder() .ConfigureLogging((ctx, builder) => { AddBareConsoleFormatterIfConfigured(ctx, builder); }) .ConfigureServices((ctx, services) => { Configuration = ctx.Configuration; RegisterServices(services); }); await builder.RunAsync <Program>(args, options => { options.TreatPublicMethodsAsCommands = false; }); await Task.CompletedTask; }
internal static CoconaApp RegisterParserCommands(this CoconaApp app) { app.AddSubCommand("parse", command => { command.AddCommand("local", ([FromService] IParserService parserService, [Option('d', Description = "The day which should be parsed (format: yyyyMMdd). Default is today.")] string?day, [Option('r', Description = "Creates the timeline in reverse date order.")] bool reverse, [Option('k', Description = "Only uses the logs that killed the boss for the timeline.")] bool killOnly, [Option('f', Description = "Only uses the logs that are in the list of boss ids (in the config.json file) for the timeline.")] bool filter ) => { parserService.ParseLogsFromDisk(day, reverse, killOnly, filter); })
static void Main(string[] args) { // Cocona parses command-line and executes a command. CoconaApp.Run <Program>(args); }
static void Main(string[] args) { CoconaApp.Run <Program>(args); }
public void ExecuteWithCocona() => CoconaApp.Run <CoconaCommand>(Arguments);
static void Main(string[] args) { CoconaApp.Run(args, new[] { typeof(Program), typeof(GreeterCommands) }); }