better help for positional args
[pharext/pharext] / src / pharext / Cli / Args.php
index c248a74dcc964c81c089d1b2204a8cacfe3dcfb0..7334290f4f070c8b2f5f5474fc619bf6b7a4eb8a 100644 (file)
@@ -207,7 +207,7 @@ class Args implements \ArrayAccess
                $args = [];
                foreach ($this->spec as $spec) {
                        $opt = $this->opt($spec[1]);
-                       $args[$opt] = $this[$opt];
+                       $args[$opt] = is_numeric($spec[0]) ? $this[$spec[0]] : $this[$opt];
                }
                return $args;
        }