mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
29 lines
920 B
C#
29 lines
920 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using CommandLine;
|
|
using Wabbajack.Common;
|
|
using Wabbajack.Lib.Downloaders;
|
|
|
|
namespace Wabbajack.CLI.Verbs
|
|
{
|
|
[Verb("parse-meta", HelpText = "Parse a .meta file, figure out the download state and print it")]
|
|
public class ParseMeta : AVerb
|
|
{
|
|
|
|
[Option('i', "input", Required = true, HelpText = "Input meta file to parse")]
|
|
public string Input { get; set; } = "";
|
|
protected override async Task<ExitCode> Run()
|
|
{
|
|
var meta = (AbstractDownloadState)await DownloadDispatcher.ResolveArchive(((AbsolutePath)Input).LoadIniFile());
|
|
if (meta == null)
|
|
{
|
|
Console.WriteLine("Cannot resolve meta!");
|
|
return ExitCode.Error;
|
|
}
|
|
|
|
Console.WriteLine($"PrimaryKeyString : {meta.PrimaryKeyString}");
|
|
return ExitCode.Ok;
|
|
}
|
|
}
|
|
}
|