Lines Matching defs:arg
109 * @param string $arg argument name (just for help)
115 public function registerArgument($arg, $help, $required = true, $command = '')
122 'name' => $arg,
196 foreach ($this->setup[$this->command]['args'] as $arg) {
197 if (!$arg['required']) {
227 $arg = $this->args[$i];
231 if ($arg == '--') {
237 if ($arg == '-') {
243 if ($arg[0] != '-') {
249 if (strlen($arg) > 1 && $arg[1] === '-') {
250 $arg = explode('=', substr($arg, 2), 2);
251 $opt = array_shift($arg);
252 $val = array_shift($arg);
276 $opt = substr($arg, 1);
278 throw new Exception("No such option $arg", Exception::E_UNKNOWN_OPT);
290 throw new Exception("Option $arg requires an argument",
395 foreach ($this->setup[$command]['args'] as $arg) {
396 $out = $this->colors->wrap('<' . $arg['name'] . '>', Colors::C_CYAN);
398 if (!$arg['required']) {
452 foreach ($this->setup[$command]['args'] as $arg) {
453 $name = '<' . $arg['name'] . '>';
457 array('', $name, $arg['help']),