Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Nov 22, 2023
1 parent 69dcd95 commit 62e25bb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions CliWrap/CommandResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace CliWrap;
/// <summary>
/// Result of a command execution.
/// </summary>
public class CommandResult
public partial class CommandResult
{
/// <summary>
/// Exit code set by the underlying process.
Expand Down Expand Up @@ -41,9 +41,18 @@ public CommandResult(int exitCode, DateTimeOffset startTime, DateTimeOffset exit
StartTime = startTime;
ExitTime = exitTime;
}
}

public partial class CommandResult
{
/// <summary>
/// Converts the result to an integer value that corresponds to the <see cref="ExitCode" /> property.
/// </summary>
// This is only needed by CliWrap.Magic, but we can't implement this operator in another assembly
public static implicit operator int(CommandResult result) => result.ExitCode;

/// <summary>
/// Converts the result to a boolean value indicating whether the command execution was successful.
/// Converts the result to a boolean value that corresponds to the <see cref="IsSuccess" /> property.
/// </summary>
// This is only needed by CliWrap.Magic, but we can't implement this operator in another assembly
public static implicit operator bool(CommandResult result) => result.IsSuccess;
Expand Down

0 comments on commit 62e25bb

Please sign in to comment.