Lines Matching refs:argv
20 protected $argv;
25 function __construct($argc, array $argv)
28 $this->argv = $argv;
33 self::error("No command given, check ${argv[0]} help\n");
34 } elseif (!isset($this->cmds[$argv[1]]['run'])) {
35 self::error("Unknown command '${argv[1]}', check ${argv[0]} help\n");
37 $command = $argv[1];
45 if ($argv[$i][0] == '-') {
46 if (strlen($argv[$i]) == 2 && isset($this->args[$argv[$i][1]])) {
47 $arg = $argv[$i][1];
49 …self::error("Missing argument to parameter '$arg' of command '$command', check ${argv[0]} help\n");
51 $this->args[$arg]['val'] = $this->checkArgTyp($arg, $i, $argc, $argv);
54 … self::error("Unknown parameter '${argv[$i]}' to command $command, check ${argv[0]} help\n");
64 … self::error("Missing default trailing arguments to command $command, check ${argv[0]} help\n");
69 $this->args['']['val'][] = $argv[$i++];
73 … self::error("Unexpected default arguments to command $command, check ${argv[0]} help\n");
78 … $missing .= "Missing parameter '-$arg' to command $command, check ${argv[0]} help\n";
101 function checkArgTyp($arg, $i, $argc, $argv)
106 … return call_user_func(array($this, $this->typs[$typ]['typ']), $argv[$i], $this->args[$arg], $arg);
108 return $argv[$i];
288 $argv = $this->argv;
307 echo "\n$argv[0] <command> [options]\n\n";