From 6ffd2cfe41f46213c3ae938e9366ee77d6a2187b Mon Sep 17 00:00:00 2001 From: Jonathan Lipps Date: Fri, 28 Sep 2012 16:14:55 -0700 Subject: [PATCH] added better cmdline option for windows --- README.md | 4 ++-- bin/paraunit | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f74add8..f9971b7 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ Usage ----- Install using composer. Then do this: -```vendor/bin/paraunit -p[PROCESSES] --PATH=TEST_PATH/TEST_GLOB ---PHPUNIT=PATH/TO/PHPUNIT``` +```vendor/bin/paraunit (-pPROCESSES|--processes=PROCESSES) --path=TEST_PATH/TEST_GLOB +--phpunit=PATH/TO/PHPUNIT``` Todo ---- diff --git a/bin/paraunit b/bin/paraunit index 556d543..a2c99e3 100755 --- a/bin/paraunit +++ b/bin/paraunit @@ -190,14 +190,16 @@ $PHPUNIT = dirname(__FILE__).'/../../../bin/phpunit'; function main($argv) { global $PHPUNIT; - $usage = "Usage: paraunit -p[NUM_PROCESSES] --path=TEST_PATH/TEST_GLOB --phpunit=PATH/TO/PHPUNIT\n"; + $usage = "Usage: paraunit (-p[NUM_PROCESSES]|--processes=[NUM_PROCESSES]) --path=TEST_PATH/TEST_GLOB --phpunit=PATH/TO/PHPUNIT\n"; if (!isset($argv[1]) || !$argv[1]) die($usage); - $opts = getopt("p::", array('path:', 'phpunit::')); + $opts = getopt("p::", array('path:', 'phpunit::', 'processes::')); if (!isset($opts['path'])) die($usage); - if (isset($opts['p']) && intval($opts['p']) > 0) + if (isset($opts['processes']) && intval($opts['processes']) > 0) + $processes = intval($opts['processes']); + elseif (isset($opts['p']) && intval($opts['p']) > 0) $processes = intval($opts['p']); else $processes = 1; @@ -211,10 +213,7 @@ function main($argv) if ($PHPUNIT != 'phpunit' && !is_file($PHPUNIT)) die("Couldn't find phpunit at '$PHPUNIT'\n"); - echo "Using phpunit at $PHPUNIT...\n"; - - //if ($opts['path'][0] != '/') - //$opts['path'] = getcwd().'/'.$opts['path']; + echo "Using phpunit in $processes process(es) with $PHPUNIT\n"; $files = getFiles($opts['path'], getcwd());