RequiresAllowedExitCode(Int32[]) Method

Definition

Assembly CliInvoke.Core.dll

A validation rule that checks whether the process result's exit code is one of the specified allowed exit codes.

public static Func<TProcessResult, bool> RequiresAllowedExitCode(params int[] exitCodes)

Parameters

exitCodes
Int32[]

The collection of allowed exit codes that the process result can match for the validation to succeed.

Returns

Func<TProcessResult, Boolean>
A function that takes an instance of TProcessResult as input and evaluates to true if the exit code matches any in the provided collection; otherwise, false.