From e458434f1a5539f1905e61835bed0123f1635067 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 8 May 2015 10:54:09 +0200 Subject: [PATCH] add Cli\Args::toArray() --- src/pharext/Cli/Args.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pharext/Cli/Args.php b/src/pharext/Cli/Args.php index 38cfaca..07fa892 100644 --- a/src/pharext/Cli/Args.php +++ b/src/pharext/Cli/Args.php @@ -176,6 +176,16 @@ class Args implements \ArrayAccess } } + + public function toArray() { + $args = []; + foreach ($this->spec as $spec) { + $opt = $this->opt($spec[1]); + $args[$opt] = $this[$opt]; + } + return $args; + } + /** * Retreive the default argument of an option * @param string $o -- 2.30.2