-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc0bf0b
commit bedb272
Showing
4 changed files
with
8 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 2 additions & 20 deletions
22
Src/GBX.NET.Tool.CLI/InputArguments/StandardInputArgument.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,9 @@ | ||
using GBX.NET.Exceptions; | ||
|
||
namespace GBX.NET.Tool.CLI.InputArguments; | ||
namespace GBX.NET.Tool.CLI.InputArguments; | ||
|
||
public sealed record StandardInputArgument(Stream Stream) : InputArgument | ||
{ | ||
public override async Task<object?> ResolveAsync(CancellationToken cancellationToken) | ||
public override Task<object?> ResolveAsync(CancellationToken cancellationToken) | ||
{ | ||
var position = Stream.Position; | ||
|
||
try | ||
{ | ||
if (Gbx.IsCompressed(Stream)) | ||
{ | ||
Stream.Position = position; | ||
return await Gbx.ParseAsync(Stream, cancellationToken: cancellationToken); | ||
} | ||
} | ||
catch (NotAGbxException) | ||
{ | ||
|
||
} | ||
|
||
Stream.Position = position; | ||
return Task.FromResult((object?)Stream); | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
Src/GBX.NET.Tool.CLI/InputArguments/StandardTextInputArgument.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters