projects
/
pharext
/
pharext
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
| inline |
side by side
add Cli\Args::toArray()
[pharext/pharext]
/
src
/
pharext
/
Cli
/
Args.php
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