Results
Result factory helpers.
- Kind:
Class - Namespace: Repl
- Assembly:
Repl.Core - Source: src/Repl.Core/Results.cs
Signature
Section titled “Signature”public static class ResultsInheritance
Section titled “Inheritance”Methods
Section titled “Methods”Cancelled(string)
Section titled “Cancelled(string)”Creates a cancelled result (e.g. user declined a confirmation prompt).
public static IReplResult Cancelled(string message)Parameters
Section titled “Parameters”message(string): Cancellation message.
Returns
Section titled “Returns”IReplResult - A cancelled result.
EnterInteractive(object?)
Section titled “EnterInteractive(object?)”Signals that the process should enter interactive REPL mode after command completion. When returned from a CLI one-shot command, the process renders the optional payload and then enters the interactive REPL loop instead of exiting. Also works as the last element of a tuple return.
public static EnterInteractiveResult EnterInteractive(object? payload = null)Parameters
Section titled “Parameters”payload(object): Optional payload to render before entering interactive mode.
Returns
Section titled “Returns”EnterInteractiveResult - An enter-interactive result.
Error(string, string)
Section titled “Error(string, string)”Creates an error result.
public static IReplResult Error(string code, string message)Parameters
Section titled “Parameters”Returns
Section titled “Returns”IReplResult - An error result.
Exit(int, object?)
Section titled “Exit(int, object?)”Creates an explicit process exit result with an optional payload to render.
public static IExitResult Exit(int code, object? payload = null)Parameters
Section titled “Parameters”code(int): Process exit code.payload(object): Optional payload rendered through configured output format.
Returns
Section titled “Returns”IExitResult - An explicit exit result.
NavigateTo(string, object?)
Section titled “NavigateTo(string, object?)”Requests interactive navigation to an explicit scope path after command completion.
public static ReplNavigationResult NavigateTo(string targetPath, object? payload = null)Parameters
Section titled “Parameters”Returns
Section titled “Returns”ReplNavigationResult - A navigation result.
NavigateUp(object?)
Section titled “NavigateUp(object?)”Requests interactive navigation one level up after command completion.
public static ReplNavigationResult NavigateUp(object? payload = null)Parameters
Section titled “Parameters”payload(object): Payload to render.
Returns
Section titled “Returns”ReplNavigationResult - A navigation result.
NotFound(string)
Section titled “NotFound(string)”Creates a not-found result.
public static IReplResult NotFound(string message)Parameters
Section titled “Parameters”message(string): Not-found message.
Returns
Section titled “Returns”IReplResult - A not-found result.
Ok(string)
Section titled “Ok(string)”Creates a conventional success text result.
public static IReplResult Ok(string content)Parameters
Section titled “Parameters”content(string): Text content.
Returns
Section titled “Returns”IReplResult - A text result.
Success(string, object?)
Section titled “Success(string, object?)”Creates a structured success result.
public static IReplResult Success(string message, object? details = null)Parameters
Section titled “Parameters”Returns
Section titled “Returns”IReplResult - A success result.
Text(string)
Section titled “Text(string)”Creates a plain text result.
public static IReplResult Text(string content)Parameters
Section titled “Parameters”content(string): Text content.
Returns
Section titled “Returns”IReplResult - A text result.
Validation(string, object?)
Section titled “Validation(string, object?)”Creates a validation result.
public static IReplResult Validation(string message, object? details = null)Parameters
Section titled “Parameters”Returns
Section titled “Returns”IReplResult - A validation result.