Table of Contents

Class CommandResult

Namespace
Ando.Execution
Assembly
ando.dll

Result of executing a command. Immutable record to prevent accidental modification of results.

public record CommandResult : IEquatable<CommandResult>
Inheritance
CommandResult
Implements
Inherited Members

Constructors

CommandResult(int, bool, string?, string?)

Result of executing a command. Immutable record to prevent accidental modification of results.

public CommandResult(int ExitCode, bool Success, string? Error = null, string? Output = null)

Parameters

ExitCode int
Success bool
Error string
Output string

Properties

Error

public string? Error { get; init; }

Property Value

string

ExitCode

public int ExitCode { get; init; }

Property Value

int

Output

public string? Output { get; init; }

Property Value

string

Success

public bool Success { get; init; }

Property Value

bool

Methods

Failed(int, string?, string?)

public static CommandResult Failed(int exitCode, string? error = null, string? output = null)

Parameters

exitCode int
error string
output string

Returns

CommandResult

Ok(string?)

public static CommandResult Ok(string? output = null)

Parameters

output string

Returns

CommandResult