-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #12
- Loading branch information
Showing
4 changed files
with
32 additions
and
40 deletions.
There are no files selected for viewing
25 changes: 19 additions & 6 deletions
25
src/Converter/ConverterService.cs → ...ConvertDbfToCsv/ConvertDbfToCsvCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,16 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
|
||
using CommandLine; | ||
using Converter; | ||
using Cocona; | ||
using Converter.Commands.ConvertDbfToCsv; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
|
||
Parser.Default.ParseArguments<Options>(args) | ||
.WithParsed(options => | ||
{ | ||
Console.WriteLine("Visual FoxPro 2 CSV Converter v1.0.0"); | ||
Console.WriteLine("====================================="); | ||
Console.WriteLine(); | ||
|
||
var builder = Host.CreateDefaultBuilder(args); | ||
builder.ConfigureServices(services => | ||
{ | ||
services.AddSingleton(options); | ||
services.AddSingleton<ConverterService>(); | ||
}); | ||
|
||
var app = builder.Build(); | ||
|
||
var converter = app.Services.GetRequiredService<ConverterService>(); | ||
converter.Convert(); | ||
}); | ||
var builder = CoconaApp.CreateBuilder(); | ||
builder.Services.AddSingleton<ConvertDbfToCsvCommand>(); | ||
|
||
var app = builder.Build(); | ||
|
||
Console.WriteLine("Visual FoxPro 2 CSV Converter v1.0.0"); | ||
Console.WriteLine("====================================="); | ||
Console.WriteLine(); | ||
|
||
app.AddCommands<ConvertDbfToCsvCommand>(); | ||
|
||
app.Run(); |