|
1 | | -using System; |
2 | | -using System.Collections.Generic; |
3 | | -using System.Linq; |
4 | | -using System.Text; |
5 | | -using System.Threading.Tasks; |
6 | | -using System.CommandLine; |
| 1 | +using System.CommandLine; |
7 | 2 | using CRIDemuxer.FileTypes; |
8 | 3 |
|
9 | 4 | namespace CRIDemuxer |
@@ -38,7 +33,7 @@ private static async Task<int> Main(string[] args) |
38 | 33 | name: "-b", |
39 | 34 | description: "4 higher bytes of the key"); |
40 | 35 |
|
41 | | - var rootCommand = new RootCommand("Sample app for System.CommandLine"); |
| 36 | + var rootCommand = new RootCommand("An .usm extraction tool for GI."); |
42 | 37 | rootCommand.AddGlobalOption(outputFolderOption); |
43 | 38 |
|
44 | 39 |
|
@@ -91,6 +86,8 @@ private static async Task DemuxUsmCommand(FileInfo file, string key1, string key |
91 | 86 | { |
92 | 87 | if (file == null) throw new ArgumentNullException("No file provided."); |
93 | 88 | if (!file.Exists) throw new ArgumentException("File {0} does not exist.", file.Name); |
| 89 | + if (!file.Name.EndsWith(".usm")) |
| 90 | + throw new ArgumentException($"File {file.Name} provided isn't a .usm file."); |
94 | 91 | if (key1!=null && key2!= null && (key1.Length != 8 || key2.Length != 8)) throw new ArgumentException("Keys are invalid."); |
95 | 92 | string outputArg = (output == null) |
96 | 93 | ? file.Directory.FullName |
@@ -125,7 +122,7 @@ private static async Task ConvertHcaCommand(FileSystemInfo input, DirectoryInfo? |
125 | 122 | { |
126 | 123 | case FileInfo f: |
127 | 124 | // TODO add keys :shrug: |
128 | | - if (f.Name.EndsWith(".hca")) throw new ArgumentException("File provided is not a .hca file."); |
| 125 | + if (!f.Name.EndsWith(".hca")) throw new ArgumentException("File provided is not a .hca file."); |
129 | 126 | HCA file = new(f.FullName); |
130 | 127 | file.ConvertToWAV(outputArg); |
131 | 128 | break; |
|
0 commit comments