This commit is contained in:
Timothy Baldridge 2020-08-03 20:41:29 -06:00
parent ff96b54d35
commit c782b63c6c
3 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,24 @@
using System;
using System.Threading.Tasks;
using CommandLine;
using Wabbajack.Common;
namespace Wabbajack.CLI.Verbs
{
[Verb("hash-variants", HelpText = "Print all the known variants (formats) of a hash")]
public class HashVariants : AVerb
{
[Option('i', "input", Required = true, HelpText = "Input Hash")]
public string Input { get; set; } = "";
protected override async Task<ExitCode> Run()
{
var hash = Hash.Interpret(Input);
Console.WriteLine($"Base64: {hash.ToBase64()}");
Console.WriteLine($"Hex: {hash.ToHex()}");
Console.WriteLine($"Long: {(long)hash}");
Console.WriteLine($"ULong (uncommon): {(ulong)hash}");
return ExitCode.Ok;
}
}
}

View File

@ -0,0 +1,28 @@
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;
}
}
}

View File

@ -669,6 +669,25 @@ CONSTRAINT [PK_NexusModPermissions] PRIMARY KEY CLUSTERED
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[MirroredArchives] Script Date: 8/3/2020 8:39:33 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MirroredArchives](
[Hash] [bigint] NOT NULL,
[Created] [datetime] NOT NULL,
[Uploaded] [datetime] NULL,
[Rationale] [nvarchar](max) NOT NULL,
CONSTRAINT [PK_MirroredArchives] PRIMARY KEY CLUSTERED
(
[Hash] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object: StoredProcedure [dbo].[MergeAllFilesInArchive] Script Date: 3/28/2020 4:58:59 PM ******/