@Override
  public int handleParseException(final CommandLine.ParameterException ex, final String[] args) {
    final CommandLine cmd = ex.getCommandLine();
    final PrintWriter err = cmd.getErr();
    final String logLevel = levelSupplier.get();
    if (logLevel != null
        && (logLevel.equals("DEBUG") || logLevel.equals("TRACE") || logLevel.equals("ALL"))) {
      ex.printStackTrace(err);
    } else {
      err.println(ex.getMessage());
    }

    CommandLine.UnmatchedArgumentException.printSuggestions(ex, err);

    // don't print full help, just the instructions required to get it
    err.println();
    err.println("To display full help:");
    err.println("besu [COMMAND] --help");

    final CommandSpec spec = cmd.getCommandSpec();

    return cmd.getExitCodeExceptionMapper() != null
        ? cmd.getExitCodeExceptionMapper().getExitCode(ex)
        : spec.exitCodeOnInvalidInput();
  }
Instantiates a new Besu parameter exception handler.

@param levelSupplier the logging level supplier
app/src/main/java/org/hyperledger/besu/cli/error/BesuParameterExceptionHandler.java