onUsageException method
UsageException?
onUsageException(
- UsageException exception,
- UsageOutputHandler usageOutput, {
- required CommandDefinition<
OptionDefinition> ? fromCommand,
Implementation
UsageException? onUsageException(
final UsageException exception,
final UsageOutputHandler usageOutput, {
required final CommandDefinition? fromCommand,
}) {
if (!usageOutput.exceptionSettings.noUsageExceptionOutput) {
final exceptionPrinter = usageOutput.exceptionSettings.exceptionPrinter;
exceptionPrinter.printException(
exception,
usageOutput: usageOutput,
fromCommand: fromCommand,
);
}
if (usageOutput.exceptionSettings.noUsageException) {
return null;
}
return exception;
}