private void commandLs(CliCommand command) {
    List<Integer> execIds = new ArrayList<>();
    String parameters = command.getParameters();
    if (CliUtil.isNullOrEmpty(parameters)) {
      execIds.addAll(executions.keySet());
    } else {
      execIds.addAll(splitExecutionIds(parameters));
    }
    if (execIds.size() == 0) {
      return;
    }

    execIds.sort(Integer::compareTo);
    final int terminalWidth = terminal.getWidth();
    final int idWidth = 3;
    final int statusWidth = 20;
    final int cmdWidth = terminalWidth - idWidth - statusWidth - 4;

    AttributedStyle oddLineStyle = AttributedStyle.DEFAULT.BOLD.foreground(AttributedStyle.BLUE);
    AttributedStyle evenLineStyle = AttributedStyle.DEFAULT.BOLD.foreground(AttributedStyle.CYAN);
    for (int i = 0; i < execIds.size(); ++i) {
      Integer id = execIds.get(i);
      String cmd = executions.get(id);
      if (cmd == null)
        continue;

      String status = "UNKNOWN";
      try {
        ExecutionStatus execStatus = executor.queryExecutionStatus(id);
        status = execStatus.name();
      } catch (ExecutorException e) {
        LOG.error("Error in commandLs: ", e);
      }

      int cmdStartIdx = 0;
      int cmdLength = cmd.length();
      StringBuilder line;
      while (cmdStartIdx < cmdLength) {
        line = new StringBuilder(terminalWidth);
        if (cmdStartIdx == 0) {
          line.append(CliConstants.SPACE);
          line.append(id);
          CliUtil.appendTo(line, 1 + idWidth + 1, CliConstants.SPACE);
          line.append(status);
        }
        CliUtil.appendTo(line, 1 + idWidth + 1 + statusWidth + 1, CliConstants.SPACE);

        int numToWrite = Math.min(cmdWidth, cmdLength - cmdStartIdx);
        if (numToWrite > 0) {
          line.append(cmd, cmdStartIdx, cmdStartIdx + numToWrite);
          cmdStartIdx += numToWrite;
        }

        if (i % 2 == 0) {
          AttributedStringBuilder attrBuilder = new AttributedStringBuilder().style(evenLineStyle);
          attrBuilder.append(line.toString());
          writer.println(attrBuilder.toAnsi());
        } else {
          AttributedStringBuilder attrBuilder = new AttributedStringBuilder().style(oddLineStyle);
          attrBuilder.append(line.toString());
          writer.println(attrBuilder.toAnsi());
        }
      }
    }
    writer.flush();
  }
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