@Override
    public ResultModel preExecution(GfshParseResult parseResult) {
      String onGroup = parseResult.getParamValueAsString(CliStrings.GROUP);
      String onMember = parseResult.getParamValueAsString(CliStrings.MEMBER);

      String functionId = parseResult.getParamValueAsString(CliStrings.DESTROY_FUNCTION__ID);

      if ((onGroup == null && onMember == null)) {
        Response response = readYesNo(
            "Do you really want to destroy " + functionId + " on entire DS?", Response.NO);
        if (response == Response.NO) {
          return ResultModel.createError("Aborted destroy of " + functionId);
        } else {
          return ResultModel.createInfo("Destroying " + functionId);
        }
      } else {
        return ResultModel.createInfo("Destroying " + functionId);
      }
    }
Interceptor used by gfsh to intercept execution of destroy.
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyFunctionCommand.java