Ah, there is the InterceptinParser.
authorJan Schneider <jan@horde.org>
Thu, 18 Mar 2010 18:38:53 +0000 (19:38 +0100)
committerJan Schneider <jan@horde.org>
Thu, 18 Mar 2010 18:38:53 +0000 (19:38 +0100)
framework/Argv/test/Horde/Argv/CallbackVarArgsTest.php
framework/Argv/test/Horde/Argv/InterceptingParser.php

index 0a0a074..9caf2b8 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 require_once dirname(__FILE__) . '/TestCase.php';
+require_once dirname(__FILE__) . '/InterceptingParser.php';
 
 /**
  * @author     Chuck Hagenbuch <chuck@horde.org>
@@ -20,8 +21,8 @@ class Horde_Argv_CallbackVarArgsTest extends Horde_Argv_TestCase
             $this->makeOption('-b', array('action' => 'store_true', 'dest' => 'b')),
             $this->makeOption('-c', '--callback', array('action' => 'callback', 'callback' => array($this, 'variableArgs'), 'dest' => 'c')),
         );
-        $this->parser = new Horde_Argv_Parser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE,
-                                                    'optionList' => $options));
+        $this->parser = new Horde_Argv_InterceptingParser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE,
+                                                                'optionList' => $options));
     }
 
     public function variableArgs($option, $opt, $value, $parser)
index 2878d19..e089c1a 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+
+require_once dirname(__FILE__) . '/InterceptedException.php';
+
 /**
  * @author     Chuck Hagenbuch <chuck@horde.org>
  * @author     Mike Naberezny <mike@maintainable.com>