UsageExceptionHandler typedef

UsageExceptionHandler = UsageException? Function(UsageException exception, UsageOutputHandler usageOutput, {required CommandDefinition<OptionDefinition>? fromCommand})

exception is typically a CommandUsageException. fromCommand is a fallback if it isn't.

Implementation

typedef UsageExceptionHandler =
    UsageException? Function(
      UsageException exception,
      UsageOutputHandler usageOutput, {
      required CommandDefinition? fromCommand,
    });