Skip to content

Commit bf0cd1a

Browse files
committed
Rename command line options
1 parent 5a39e1a commit bf0cd1a

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

HashDumper/HashDumper.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8+
9+
<Version>1.1.0</Version>
810
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
911
</PropertyGroup>
1012

HashDumper/Program.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,24 @@
1616
description: "The path of the output file"),
1717

1818
new Option<Game>(
19-
name: "--game",
19+
aliases: ["-g", "--game"],
2020
description: "The game of the files",
2121
getDefaultValue: () => Game.Legend),
2222

2323
new Option<Endianness>(
24-
name: "--endianness",
24+
aliases: ["-e", "--endianness"],
2525
description: "The endianness of the files",
2626
getDefaultValue: () => Endianness.LittleEndian),
2727

2828
new Option<string>(
29-
name: "--pattern",
29+
aliases: ["-p", "--pattern"],
3030
description: "The pattern of the archives to scan",
3131
getDefaultValue: () => "*.000"),
3232

33-
new Option<OutputFormat>(
34-
name: "--output-format",
33+
new Option<Format>(
34+
aliases: ["-f", "--format"],
3535
description: "The format to output the data in",
36-
getDefaultValue: () => OutputFormat.Text),
36+
getDefaultValue: () => Format.Text),
3737
};
3838

3939
command.Handler = CommandHandler.Create(Execute);
@@ -42,7 +42,7 @@
4242
await command.InvokeAsync(args);
4343

4444
static void Execute(
45-
DirectoryInfo path, FileInfo output, Game game, Endianness endianness, string pattern, OutputFormat outputFormat)
45+
DirectoryInfo path, FileInfo output, Game game, Endianness endianness, string pattern, Format format)
4646
{
4747
List<ulong> hashes = [];
4848

@@ -71,13 +71,13 @@ static void Execute(
7171
}
7272

7373
// Write the output
74-
switch (outputFormat)
74+
switch (format)
7575
{
76-
case OutputFormat.Text:
76+
case Format.Text:
7777
File.WriteAllLines(output.FullName, hashes.Select(hash => hash.ToString("X8")));
7878

7979
break;
80-
case OutputFormat.Json:
80+
case Format.Json:
8181
File.WriteAllText(output.FullName, JsonSerializer.Serialize(hashes));
8282

8383
break;
@@ -102,7 +102,7 @@ enum Game
102102
Tiger
103103
}
104104

105-
enum OutputFormat
105+
enum Format
106106
{
107107
Text,
108108
Json

0 commit comments

Comments
 (0)