Skip to content

InputExtensions

Registers advanced input callbacks on a DI-enabled application.

public static class InputExtensions

UseArgumentPreprocessor(ReplApp, Func<ArgumentPreprocessingContext, CancellationToken, ArgumentPreprocessingResult>)

Section titled “UseArgumentPreprocessor(ReplApp, Func<ArgumentPreprocessingContext, CancellationToken, ArgumentPreprocessingResult>)”

Adds an argument adapter, including for preview and completion requests.

public static ReplApp UseArgumentPreprocessor(this ReplApp app, Func<ArgumentPreprocessingContext, CancellationToken, ArgumentPreprocessingResult> preprocessor)
  • app (ReplApp): Application to configure.
  • preprocessor (Func<ArgumentPreprocessingContext, CancellationToken, ArgumentPreprocessingResult>): Callback returning an explicit argument decision.

ReplApp - The same application.

UseArgumentPreprocessor(ReplApp, Func<ArgumentPreprocessingContext, CancellationToken, ValueTask<ArgumentPreprocessingResult>>)

Section titled “UseArgumentPreprocessor(ReplApp, Func<ArgumentPreprocessingContext, CancellationToken, ValueTask<ArgumentPreprocessingResult>>)”

Adds an argument adapter, including for preview and completion requests.

public static ReplApp UseArgumentPreprocessor(this ReplApp app, Func<ArgumentPreprocessingContext, CancellationToken, ValueTask<ArgumentPreprocessingResult>> preprocessor)
  • app (ReplApp): Application to configure.
  • preprocessor (Func<ArgumentPreprocessingContext, CancellationToken, ValueTask<ArgumentPreprocessingResult>>): Callback returning an explicit argument decision.

ReplApp - The same application.

Adds a validator returning InputValidationResult, with parameters resolved from the current scope.

public static ReplApp UseInputValidator(this ReplApp app, Delegate validator)
  • app (ReplApp): Application to configure.
  • validator (Delegate): Validator accepting ParsedInputContext, services and/or CancellationToken.

ReplApp - The same application.