private static @Nullable WSLToolFlags getWSLToolFlagsInternal() {
    final Path wslExe = WSLDistribution.findWslExe();
    if (wslExe == null) return null;

    final GeneralCommandLine commandLine = new GeneralCommandLine(wslExe.toString(), "--help").
      withCharset(StandardCharsets.UTF_16LE);

    try {
      final ProcessOutput output = ExecUtil.execAndGetOutput(commandLine, 5000);
      if (output.isTimeout()) return null;

      // intentionally do no check "wsl --help" exit code because it returns -1
      final String stdout = output.getStdout();
      return new WSLToolFlags(QUIET.matcher(stdout).find(),
                              VERBOSE.matcher(stdout).find());
    }
    catch (Exception e) {
      LOG.warn(e);
      return null;
    }
  }
private static @Nullable WSLToolFlags getWSLToolFlagsInternal()