<?php

$pharFile = $argv[1] ?? null;
$dstPath = $argv[2] ?? null;

if (! $dstPath) {
    throw new InvalidArgumentException('Dst path must be provided');
}

if (! $pharFile) {
    throw new InvalidArgumentException('Phar file must be provided');
}

$phar = new Phar($pharFile);
$phar->extractTo($dstPath);

echo "Phar extracted: $pharFile\n";
