Beispiel #1
0
 /**
  * Returns long description of this command by parsing the docs
  *
  * @return array
  */
 function getLongdesc()
 {
     $binding = [];
     $configurator = new Configurator();
     $spec = $configurator->getSpec();
     foreach ($spec as $key => $details) {
         if ($details['runtime'] === false || isset($details['deprecated']) || isset($details['hidden'])) {
             continue;
         } else {
             $synopsis = "--{$key}" . $details['runtime'];
         }
         $binding['parameters'][] = array('synopsis' => $synopsis, 'desc' => $details['desc']);
     }
     return $binding;
 }
Beispiel #2
0
 /**
  * Initializes configurator, saves config data to it
  *
  * @param array $config Config options to set explicitly
  * @return void
  */
 private function setConfig($config = array())
 {
     $args = array('terminus', '--debug');
     if (isset($GLOBALS['argv'])) {
         $args = $GLOBALS['argv'];
     }
     // Runtime config and args
     list($args, $assoc_args, $runtime_config) = $this->configurator->parseArgs(array_slice($args, 1));
     $this->arguments = $args;
     $this->assoc_args = $assoc_args;
     $this->configurator->mergeArray($runtime_config);
     $this->config = array_merge($this->configurator->toArray(), $config);
 }
Beispiel #3
0
 /**
  * Dump the list of global parameters, as JSON.
  *
  * @subcommand param-dump
  */
 function paramDump()
 {
     $configurator = new Configurator();
     $this->output()->outputDump($configurator->getSpec());
 }