code: void dispatch(String line, DispatchCallback callback) {
      if (line == null) {
        // exit
        exit = true;
        return;
      }
  
      if (line.trim().length() == 0) {
        callback.setStatus(DispatchCallback.Status.SUCCESS);
        return;
      }
  
      if (isComment(line)) {
        callback.setStatus(DispatchCallback.Status.SUCCESS);
        return;
      }
  
      line = line.trim();
  
      if (isHelpRequest(line)) {
        line = COMMAND_PREFIX + "help";
      }
  
      final boolean echoToFile;
      if (line.startsWith(COMMAND_PREFIX)) {
        Map<String, CommandHandler> cmdMap = new TreeMap<>();
        String commandLine = line.substring(1);
        for (CommandHandler commandHandler : getCommandHandlers()) {
          String match = commandHandler.matches(commandLine);
          if (match != null) {
            cmdMap.put(match, commandHandler);
          }
        }
  
        final CommandHandler matchingHandler;
        switch (cmdMap.size()) {
        case 0:
          callback.setStatus(DispatchCallback.Status.FAILURE);
          error(loc("unknown-command", commandLine));
          return;
        case 1:
          matchingHandler = cmdMap.values().iterator().next();
          break;
        default:
          // look for the exact match
          matchingHandler = cmdMap.get(split(commandLine, 1)[0]);
          if (matchingHandler == null) {
            callback.setStatus(DispatchCallback.Status.FAILURE);
            error(loc("multiple-matches", cmdMap.keySet().toString()));
            return;
          }
          break;
        }
  
        echoToFile = matchingHandler.echoToFile();
        callback.setStatus(DispatchCallback.Status.RUNNING);
        matchingHandler.execute(commandLine, callback);
      } else {
        echoToFile = true;
        callback.setStatus(DispatchCallback.Status.RUNNING);
        commands.sql(line, callback);
      }
  
      // save it to the current script, if any
      if (scriptOutputFile != null && echoToFile) {
        scriptOutputFile.addLine(line);
      }
  
    }
docs: Dispatch the specified line to the appropriate {@link CommandHandler}.
  
  @param line The command-line to dispatch