public boolean handleCommand(CliCommand command) throws CommandHandlerException {
    boolean keepRunning = true;

    if (!command.getCommandType().argsAreOptional() && CliUtil.isNullOrEmpty(command.getParameters())) {
      CliUtil.printCommandUsage(command, writer);
      return true;
    }

    try {
      switch ((CliCommandType) command.getCommandType()) {
        case CLEAR:
          commandClear();
          break;

        case DESCRIBE:
          commandDescribe(command);
          break;

        case EXECUTE:
          commandExecuteFile(command);
          break;

        case EXIT:
        case QUIT:
          keepRunning = false;
          break;

        case HELP:
          commandHelp(command);
          break;

        case INSERT_INTO:
          commandInsertInto(command);
          break;

        case LS:
          commandLs(command);
          break;

        case RM:
          commandRm(command);
          break;

        case SELECT:
          commandSelect(command);
          break;

        case SET:
          commandSet(command);
          break;

        case SHOW_FUNCTIONS:
          commandShowFunctions(command);
          break;

        case SHOW_TABLES:
          commandShowTables(command);
          break;

        case STOP:
          commandStop(command);
          break;

        case VERSION:
          commandVersion();
          break;

        case INVALID_COMMAND:
          printHelpMessage();
          break;

        default:
          writer.println("UNDER DEVELOPEMENT. Command:" + command.getCommandType());
          writer.println("Parameters:" + (CliUtil.isNullOrEmpty(command.getParameters()) ? "NULL" : command.getParameters()));
          writer.flush();
      }
    } catch (Exception e) {
      throw new CommandHandlerException(e);
    }
    return keepRunning;
  }
Handles the given command
@param command input {@link CliCommand} to handle
@return false if command is to quit, or fatal error happened that Shell should not continue running. True o.w.
@throws CommandHandlerException if unrecoverable error happened while handling the input {@link CliCommand}
samza-sql-shell/src/main/java/org/apache/samza/sql/client/impl/CliCommandHandler.java