Lines Matching refs:command

23     protected $command = '';  variable in splitbrain\\phpcli\\Options
112 * @param string $command if theses apply to a sub command only
115 public function registerArgument($arg, $help, $required = true, $command = '') argument
117 if (!isset($this->setup[$command])) {
118 throw new Exception("Command $command not registered");
121 $this->setup[$command]['args'][] = array(
133 * @param string $command
137 public function registerCommand($command, $help) argument
139 if (isset($this->setup[$command])) {
140 throw new Exception("Command $command already registered");
143 $this->setup[$command] = array(
158 * @param string $command what command does this option apply to
161 public function registerOption($long, $help, $short = null, $needsarg = false, $command = '') argument
163 if (!isset($this->setup[$command])) {
164 throw new Exception("Command $command not registered");
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]])) {
305 $this->command = array_shift($this->args);
341 return $this->command;
371 foreach ($this->setup as $command => $config) {
372 $hasopts = (bool)$this->setup[$command]['opts'];
373 $hasargs = (bool)$this->setup[$command]['args'];
376 if (!$command) {
383 $text .= $this->colors->wrap(' ' . $command, Colors::C_PURPLE);
391 if (!$command && $hascommands) {
395 foreach ($this->setup[$command]['args'] as $arg) {
406 if ($this->setup[$command]['help']) {
410 array('', $this->setup[$command]['help'] . $this->newline)
416 if (!$command) {
421 foreach ($this->setup[$command]['opts'] as $long => $opt) {
447 if (!$command) {
452 foreach ($this->setup[$command]['args'] as $arg) {
464 if (!$command && $hascommands) {