ExitCodeOptions
Maps ReplExecutionOutcomeKind categories to process exit codes and exposes a final interception point. Applies to top-level runs only; nested sub-invocations use the built-in defaults.
- Kind:
Class - Namespace: Repl
- Assembly:
Repl.Core - Source: src/Repl.Core/ExitCodeOptions.cs
Signature
Section titled “Signature”public sealed class ExitCodeOptionsInheritance
Section titled “Inheritance”Properties
Section titled “Properties”BindingError
Section titled “BindingError”Gets or sets the exit code for BindingError. Default 2.
public int BindingError { get; set; }Returns
Section titled “Returns”Cancelled
Section titled “Cancelled”Gets or sets the exit code for Cancelled — a run stopped
through the caller’s own CancellationToken, whether during the command, while an
interactive session waits for input, or while hosted services were starting. When
null (the default) the OperationCanceledException propagates to
the caller instead of being converted, unless a Resolver is set, which also opts in
to observing cancellation — the resolver is then handed 130, the shell convention for
128 + SIGINT. A handler that raises OperationCanceledException without the
caller having asked for cancellation is a failure, reported as
HandlerException.
public int? Cancelled { get; set; }Returns
Section titled “Returns”int?
CompletedWithFailures
Section titled “CompletedWithFailures”Gets or sets the exit code for CompletedWithFailures.
Default 1, the code test runners such as pytest use when tests fail; Microsoft.Testing.Platform
uses 2. The default is shared with HandlerError and HandlerException:
give it a code of its own when a script must tell a run with failures from a failed command.
public int CompletedWithFailures { get; set; }Returns
Section titled “Returns”FrameworkError
Section titled “FrameworkError”Gets or sets the exit code for FrameworkError. Default 1.
public int FrameworkError { get; set; }Returns
Section titled “Returns”HandlerError
Section titled “HandlerError”Gets or sets the exit code for HandlerError. Default 1.
public int HandlerError { get; set; }Returns
Section titled “Returns”HandlerException
Section titled “HandlerException”Gets or sets the exit code for HandlerException. Default 1.
public int HandlerException { get; set; }Returns
Section titled “Returns”Gets or sets the exit code for Help. Default 0;
set it non-zero when a bare invocation must fail in scripted pipelines.
public int Help { get; set; }Returns
Section titled “Returns”Interrupted
Section titled “Interrupted”Gets or sets the exit code for Interrupted — a process
signal (SIGINT, Ctrl+Break, SIGTERM) turned into a cooperative shutdown by a process-signal
handler — ReplRunOptions.ProcessSignalHandling in automatic mode claims the signal and
reports the run as interrupted.
When null (the default) the conventional 128 + signal code the claimed
signal carries is used — 130 for SIGINT and Ctrl+Break, 143 for SIGTERM — falling
back to 130 when none is supplied. Set this to publish a single code for every signal
instead. A run that had already produced its own refusal or failure keeps reporting that instead
of the interruption; only a clean or cancelled run is reclassified.
public int? Interrupted { get; set; }Returns
Section titled “Returns”int?
Resolver
Section titled “Resolver”Gets or sets a final interception hook invoked with the structured outcome (whose ExitCode already reflects the codes the command’s module declares through IReplModuleExitCodes, then this table); its return value becomes the exit code.
public Func<ReplExecutionOutcome, int>? Resolver { get; set; }Returns
Section titled “Returns”Func<ReplExecutionOutcome, int>
Success
Section titled “Success”Gets or sets the exit code for Success. Default 0.
public int Success { get; set; }Returns
Section titled “Returns”UsageError
Section titled “UsageError”Gets or sets the exit code for UsageError. Default 2.
public int UsageError { get; set; }