From 3446fd8b28fcb7d50f24491a71176510e6ba0e5f Mon Sep 17 00:00:00 2001 From: Luciano Ciccariello Date: Tue, 12 May 2020 23:03:29 +0100 Subject: [PATCH] Allow to specify a custom IMG --- OpenKh.Command.IdxImg/Program.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OpenKh.Command.IdxImg/Program.cs b/OpenKh.Command.IdxImg/Program.cs index 4eb201369..568cd06f1 100644 --- a/OpenKh.Command.IdxImg/Program.cs +++ b/OpenKh.Command.IdxImg/Program.cs @@ -46,17 +46,20 @@ private class ExtractCommand [Required] [FileExists] - [Option(Description = "Kingdom Hearts II IDX file, paired with a IMG", ShortName = "i", LongName = "input")] + [Option(Description = "Kingdom Hearts II IDX file, paired with a IMG", ShortName = "i", LongName = "idx")] public string InputIdx { get; set; } - [DirectoryExists] + [FileExists] + [Option(Description = "Custom Kingdom Hearts II IMG file", ShortName = "m", LongName = "img")] + public string InputImg { get; set; } + [Option(Description = "Path where the content will be extracted", ShortName = "o", LongName = "output")] public string OutputDir { get; set; } protected int OnExecute(CommandLineApplication app) { - var inputImg = InputIdx.Replace(".idx", ".img", StringComparison.InvariantCultureIgnoreCase); - var outputDir = inputImg ?? Path.Combine(Path.GetFullPath(inputImg), "extract"); + var inputImg = InputImg ?? InputIdx.Replace(".idx", ".img", StringComparison.InvariantCultureIgnoreCase); + var outputDir = OutputDir ?? Path.Combine(Path.GetFullPath(inputImg), "extract"); Idx idx = OpenIdx(InputIdx);