Ejemplo n.º 1
0
 public function formatHelp(nbCommand $command)
 {
     $max = 0;
     foreach ($command->getArgumentsArray() as $argument) {
         $length = strlen($argument->getName()) + 2;
         if ($max < $length) {
             $max = $length;
         }
     }
     foreach ($command->getOptionsArray() as $option) {
         $length = strlen($option->getName()) + 6;
         if ($max < $length) {
             $max = $length;
         }
     }
     $res = nbHelpFormatter::formatSynopsys($command->getSynopsys());
     $res .= nbHelpFormatter::formatArguments($command->getArguments(), $max);
     $res .= nbHelpFormatter::formatOptions($command->getOptions(), $max - 6);
     $res .= nbHelpFormatter::formatDescription($command->getDescription());
     return $res;
 }