stabilizaiton work - projects rework for maintenanceability and ui livening
This commit is contained in:
18
src/__Libraries/StellaOps.Interop/ToolResult.cs
Normal file
18
src/__Libraries/StellaOps.Interop/ToolResult.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace StellaOps.Interop;
|
||||
|
||||
public sealed record ToolResult(
|
||||
bool Success,
|
||||
int ExitCode,
|
||||
string StdOut,
|
||||
string StdErr,
|
||||
string? Error)
|
||||
{
|
||||
public static ToolResult Ok(string stdout, string stderr, int exitCode)
|
||||
=> new(true, exitCode, stdout, stderr, null);
|
||||
|
||||
public static ToolResult Failed(string error)
|
||||
=> new(false, -1, string.Empty, string.Empty, error);
|
||||
|
||||
public static ToolResult Failed(string error, string stdout, int exitCode)
|
||||
=> new(false, exitCode, stdout, error, error);
|
||||
}
|
||||
Reference in New Issue
Block a user