Lines Matching refs:setup
9 * commands and even generates a help text from this setup.
17 protected $setup;
51 $this->setup = array(
81 $this->setup['']['help'] = $help;
91 $this->setup['']['commandhelp'] = $help;
117 if (!isset($this->setup[$command])) {
121 $this->setup[$command]['args'][] = array(
139 if (isset($this->setup[$command])) {
143 $this->setup[$command] = array(
163 if (!isset($this->setup[$command])) {
167 $this->setup[$command]['opts'][$long] = array(
178 $this->setup[$command]['short'][$short] = $long;
196 foreach ($this->setup[$this->command]['args'] as $arg) {
254 if (!isset($this->setup[$this->command]['opts'][$opt])) {
259 if ($this->setup[$this->command]['opts'][$opt]['needsarg']) {
277 if (!isset($this->setup[$this->command]['short'][$opt])) {
280 $opt = $this->setup[$this->command]['short'][$opt]; // store it under long name
284 if ($this->setup[$this->command]['opts'][$opt]['needsarg']) {
303 if (!$this->command && $this->args && isset($this->setup[$this->args[0]])) {
368 $hascommands = (count($this->setup) > 1);
369 $commandhelp = $this->setup['']["commandhelp"];
371 foreach ($this->setup as $command => $config) {
372 $hasopts = (bool)$this->setup[$command]['opts'];
373 $hasargs = (bool)$this->setup[$command]['args'];
395 foreach ($this->setup[$command]['args'] as $arg) {
406 if ($this->setup[$command]['help']) {
410 array('', $this->setup[$command]['help'] . $this->newline)
421 foreach ($this->setup[$command]['opts'] as $long => $opt) {
452 foreach ($this->setup[$command]['args'] as $arg) {