Skip to content

Commit bb3771e

Browse files
committed
Add flag to recursively scan for archives
1 parent 0855185 commit bb3771e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

HashDumper/Program.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
description: "The pattern of the archives to scan",
3131
getDefaultValue: () => "*.000"),
3232

33+
new Option<bool>(
34+
aliases: ["-r", "--recursive"],
35+
description: "Whether to recursively scan for archives"),
36+
3337
new Option<Format>(
3438
aliases: ["-f", "--format"],
3539
description: "The format to output the data in",
@@ -42,11 +46,11 @@
4246
await command.InvokeAsync(args);
4347

4448
static void Execute(
45-
DirectoryInfo path, FileInfo output, Game game, Endianness endianness, string pattern, Format format)
49+
DirectoryInfo path, FileInfo output, Game game, Endianness endianness, string pattern, bool recursive, Format format)
4650
{
4751
List<ulong> hashes = [];
4852

49-
foreach (var file in path.GetFiles(pattern))
53+
foreach (var file in path.GetFiles(pattern, recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly))
5054
{
5155
Console.WriteLine(file.Name);
5256

0 commit comments

Comments
 (0)