Program now compiles. Still untested.

This commit is contained in:
2022-05-16 02:25:54 -05:00
parent 68cd4fdcf2
commit bd51a23da3
2 changed files with 7 additions and 18 deletions

View File

@@ -7,24 +7,22 @@ using System.Resources.NetStandard;
namespace DotNetResxUtils.Commands
{
internal class GenerationCommand
internal class GenerationCommand : Command
{
const string NAME = "generate";
const string DESC = "Generate a .resx file.";
public GenerationCommand(RootCommand rootCmd)
public GenerationCommand() : base(NAME, DESC)
{
Command cmd = new Command(NAME, DESC);
rootCmd.AddCommand(cmd);
Option<FileInfo?> fromOpt = new Option<FileInfo?>("--from", "Generates a .resx file from the given file.");
Argument<FileInfo> destArg = new Argument<FileInfo>("destination", "The destination path to store this file. If no extension is given, .resx will automatically be concatenated.");
cmd.AddOption(fromOpt);
cmd.AddArgument(destArg);
this.AddOption(fromOpt);
this.AddArgument(destArg);
cmd.SetHandler<FileInfo, FileInfo?>(CommandHandler, destArg, fromOpt);
this.SetHandler<FileInfo, FileInfo?>(CommandHandler, destArg, fromOpt);
}
private async void CommandHandler(FileInfo to, FileInfo? from)
{