if ($opts->getOption('h')) { echo $opts->getUsageMessage(); exit; } if (!isset($opts->dir)) { echo "Must provide a path to git working copy via the -d or --dir option\n\n"; echo $opts->getUsageMessage(); exit(2); } $gitWorkingCopyDir = $opts->dir; if (!is_dir($gitWorkingCopyDir)) { printf("Unable to read from provided directory '%s'\n\n", $gitWorkingCopyDir); echo $opts->getUsageMessage(); exit(2); } $list = Branch::enlist($gitWorkingCopyDir, isset($opts->remote), isset($opts->merged)); $charInput = new SttyCharInput(); $confirmed = true; foreach (new PregMatchIterator('~^(.*)/task-([0-9]+)(-.+)?$~', $list) as $matches) { $issueId = $matches[2]; if (isset($opts->before) && $issueId >= $opts->before) { continue; } $branchFullName = $matches[0]; echo $issueId . ': ' . $branchFullName . ' '; $branch = new Branch($gitWorkingCopyDir, $branchFullName); $issue = new Issue(); $issue->find($issueId); if ($issue->count()) { echo '[' . $issue->status['name'] . '] '; if (in_array($issue->status['id'], Naf::config('redmine.closed_issue_status_ids'))) {