projects
/
pharext
/
pharext
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
| inline |
side by side
(parent:
b21bef6
)
add Cli\Args::toArray()
author
Michael Wallner
<mike@php.net>
Fri, 8 May 2015 08:54:09 +0000
(10:54 +0200)
committer
Michael Wallner
<mike@php.net>
Fri, 8 May 2015 08:54:09 +0000
(10:54 +0200)
src/pharext/Cli/Args.php
patch
|
blob
|
history
diff --git
a/src/pharext/Cli/Args.php
b/src/pharext/Cli/Args.php
index 38cfaca80e862546f06f989e13d7c9844c6f46cb..07fa892fd68196fe0bccf9ea29aa8261230dbf0a 100644
(file)
--- 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