private void commandSet(CliCommand command) throws Exception {
    String param = command.getParameters();
    if (CliUtil.isNullOrEmpty(param)) {
      env.printAll(writer);
      writer.flush();
      return;
    }
    String[] params = null;
    boolean syntaxValid = param.split(" ").length == 1;
    if (syntaxValid) {
      params = param.split("=");
      if (params.length == 1) {
        String value = env.getEnvironmentVariable(param);
        if (!CliUtil.isNullOrEmpty(value)) {
          env.printVariable(writer, param, value);
        }
        return;
      } else {
        syntaxValid = params.length == 2;
      }
    }
    if (!syntaxValid) {
      writer.println(command.getCommandType().getUsage());
      writer.flush();
      return;
    }

    String name = params[0].trim().toLowerCase();
    String value = params[1].trim();
    int ret = env.setEnvironmentVariable(name, value);
    if (ret == 0) {
      writer.print(name);
      writer.print(" set to ");
      writer.println(value);
      if (name.equals(CliConstants.CONFIG_EXECUTOR)) {
        executor.stop(exeContext);
        executor = env.getExecutor();
        executor.start(exeContext);
      }
    } else if (ret == -1) {
      writer.print("Unknow variable: ");
      writer.println(name);
    } else if (ret == -2) {
      writer.print("Invalid value: ");
      writer.print(value);
      String[] vals = env.getPossibleValues(name);
      if (vals != null && vals.length != 0) {
        writer.print(" Possible values:");
        for (String s : vals) {
          writer.print(CliConstants.SPACE);
          writer.print(s);
        }
        writer.println();
      }
    }

    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