27 lines
1.1 KiB
C#
27 lines
1.1 KiB
C#
using System.IO;
|
|
using System;
|
|
using System.CommandLine;
|
|
|
|
namespace DotNetResxUtils
|
|
{
|
|
internal class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
RootCommand rootCmd = new RootCommand(".Net Resx Utils provides tools for generating, and editing .resx files.");
|
|
Command genCmd = new Command("gen", "Generate a .resx file.");
|
|
rootCmd.AddCommand(genCmd);
|
|
|
|
// See: Collection organizers - https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/object-and-collection-initializers
|
|
|
|
Option<FileInfo?> convertOpt = new Option<FileInfo?>("--convert", "Generates a .resx file from the given file. Currently only supports .json files.");
|
|
genCmd.AddOption(convertOpt);
|
|
|
|
Argument<string> destArg = new Argument<string>("destination", "The destination path to store this file. If no extension is given, .resx will automatically be concatenated.");
|
|
genCmd.AddArgument(destArg);
|
|
|
|
|
|
genCmd.SetHandler(async (string dst, FileInfo? from))
|
|
}
|
|
}
|
|
} |