#!/usr/bin/env php 'Unstow files', 'b' => 'Backup existing files', 'f' => 'Force overwrite'], ['stow-directory' => 'The directory to stow'] ); $parsed = $argvParser->parseArgv($argv); if ($parsed === false) { line('Usage: ' . __FILE__ . ' ' . $argvParser->getOptionsHelp()); exit(1); } $cwd = getcwd(); $action = $parsed->get('u') ? stow::ACTION_UNSTOW : stow::ACTION_STOW; $backup = $parsed->get('b'); $force = $parsed->get('f'); $stowName = $parsed->get('stow-directory'); $stowPath = path($cwd, $stowName); $targetPath = dirname($stowPath, 2); if (!is_dir($stowPath)) { line("Directory '$stowName' does not exist"); exit(1); } $stow = new stow($action, $backup, $force); $stow->run($stowPath, $targetPath); exit(0);