Exemple #1
0
 /**
  * @return string help docs
  */
 public function getHelp()
 {
     $this->attachHelp();
     if (empty($this->name) && isset($this->tokens[0])) {
         $this->name = $this->tokens[0];
     }
     $color = new \Colors\Color();
     $help = '';
     $help .= $color(\Commando\Util\Terminal::header(' ' . $this->name))->white()->bg('green')->bold() . PHP_EOL;
     if (!empty($this->help)) {
         $help .= PHP_EOL . \Commando\Util\Terminal::wrap($this->help) . PHP_EOL;
     }
     $help .= PHP_EOL;
     $seen = array();
     $keys = array_keys($this->options);
     natsort($keys);
     foreach ($keys as $key) {
         $option = $this->getOption($key);
         if (in_array($option, $seen)) {
             continue;
         }
         $help .= $option->getHelp() . PHP_EOL;
         $seen[] = $option;
     }
     return $help;
 }
Exemple #2
0
 /**
  * @param string $msg Success message
  * @param int    $nb_eol Number of the end of lines
  */
 public static function msgSuccess($msg, $nb_eol = 2)
 {
     static::writeLn('');
     static::writeLn(static::text(Terminal::header(' ' . $msg))->white()->bg('green')->bold(), $nb_eol);
 }