Skip to content

Commit

Permalink
Allow to specify a custom IMG
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeeynamo committed May 12, 2020
1 parent a88f3f6 commit 3446fd8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions OpenKh.Command.IdxImg/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3446fd8

Please sign in to comment.