mastodon-backup-filter/Program.cs

30 lines
798 B
C#

// See https://aka.ms/new-console-template for more information
using System.Text.Json;
using System.Text.Json.Nodes;
using MastodonBackupFilter;
using System.CommandLine;
internal class Program
{
static async Task<int> Main(string[] args)
{
var fileOption = new Option<FileInfo?>(
name: "--file",
description: "The file to read");
var rootCommand = new RootCommand("Sample app for System.CommandLine");
rootCommand.AddOption(fileOption);
rootCommand.SetHandler((file) =>
{
MastodonBackup.FromFileAsync(file);
},
fileOption);
return await rootCommand.InvokeAsync(args);
var path = Environment.GetCommandLineArgs()[1];
}
}