private static void serve(CliContext ctx) {
    try {
      useSsl = commandLine.getOptionValue(USE_SSL_ARGS);
      trustStore = commandLine.getOptionValue(TRUST_STORE_ARGS);
      trustStorePwd = commandLine.getOptionValue(TRUST_STORE_PWD_ARGS);
      password = commandLine.getOptionValue(PW_ARGS);
      constructProperties();
      if (hasExecuteSQL && password != null) {
        ctx.getLineReader().getVariables().put(LineReader.DISABLE_HISTORY, Boolean.TRUE);
        executeSql(ctx);
      }
      if (password == null) {
        password = ctx.getLineReader().readLine("please input your password:", '\0');
      }
      receiveCommands(ctx);
    } catch (Exception e) {
      ctx.getPrinter().println(IOTDB_ERROR_PREFIX + ": Exit cli with error: " + e.getMessage());
      ctx.exit(CODE_ERROR);
    }
  }
IoTDB Client main function.

@param args launch arguments
@throws ClassNotFoundException ClassNotFoundException
iotdb-client/cli/src/main/java/org/apache/iotdb/cli/Cli.java