def METHOD_NAME(self) -> int:
    cmd = ['rofi-tool', 'module-count', self.file, '--format', self.format]
    cmd_result = subprocess.run(cmd, capture_output=True)
    sys.stderr.buffer.write(cmd_result.stderr)
    if cmd_result.returncode != 0:
        print(f"Error while getting module count of '{self.file}' (format: {self.format})",
              file=sys.stderr)
        exit(1)
    return int(cmd_result.stdout)