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

$xml = simplexml_load_file('phpmnd.xml');
$excludePaths = [];

foreach ($xml->exclude->path as $path) {
    $excludePaths[] = '--exclude=' . (string)$path;
}

$exclude = implode(' ', $excludePaths);

$command = "vendor/bin/phpmnd " . ($argv[2] ?? '') . " " . $exclude . " " . $argv[1];

exec($command, $output);
foreach ($output as $line) {
    echo $line . PHP_EOL;
}
