コード例 #1
0
 /**
  * Formats an option
  *
  * @param Option $option The option to format
  * @return string The formatted option
  */
 private function formatOption(Option $option)
 {
     $text = "[--{$option->getName()}";
     if ($option->valueIsOptional()) {
         $text .= "=" . $option->getDefaultValue();
     }
     if ($option->getShortName() !== null) {
         $text .= "|-{$option->getShortName()}";
     }
     $text .= "]";
     return $text;
 }
コード例 #2
0
 /**
  * Gets the option names as a formatted string
  *
  * @param Option $option The option to convert to text
  * @return string The option names as text
  */
 private function getOptionNames(Option $option)
 {
     $optionNames = "--{$option->getName()}";
     if ($option->getShortName() !== null) {
         $optionNames .= "|-{$option->getShortName()}";
     }
     return $optionNames;
 }
コード例 #3
0
ファイル: Command.php プロジェクト: scaleddynamics/Opulence
 /**
  * @inheritdoc
  */
 public function addOption(Option $option)
 {
     $this->options[$option->getName()] = $option;
     return $this;
 }