diff --git a/CliWrap/CommandResult.cs b/CliWrap/CommandResult.cs index 3afc6497..10201346 100644 --- a/CliWrap/CommandResult.cs +++ b/CliWrap/CommandResult.cs @@ -5,7 +5,7 @@ namespace CliWrap; /// /// Result of a command execution. /// -public class CommandResult +public partial class CommandResult { /// /// Exit code set by the underlying process. @@ -41,9 +41,18 @@ public CommandResult(int exitCode, DateTimeOffset startTime, DateTimeOffset exit StartTime = startTime; ExitTime = exitTime; } +} + +public partial class CommandResult +{ + /// + /// Converts the result to an integer value that corresponds to the property. + /// + // 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; /// - /// 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 property. /// // 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;