#!/usr/bin/env php
<?php

foreach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php'] as $file) {
    if (file_exists($file)) {
        require $file;
        break;
    }
}

use WP_Since\Runner\PluginCheckCommand;

if ($argc < 2 || $argv[1] !== 'check') {
    echo "🛠 Usage: wp-since check /path/to/plugin\n";
    exit(0);
}

$pluginPath = $argv[2] ?? getcwd();
$sinceMapPath = __DIR__ . '/../wp-since.json';

exit(PluginCheckCommand::run($pluginPath, $sinceMapPath));
