renderValueHint() 공개 메소드

public renderValueHint ( )
예제 #1
0
 public function testValueName()
 {
     $opt = new Option('z');
     $opt->defaultValue(10);
     $opt->valueName('priority');
     $this->assertEquals('[=priority]', $opt->renderValueHint());
     $this->assertEquals('-z[=priority]', $opt->renderReadableSpec());
 }
 /**
  * Render readable spec
  */
 public function renderOption(Option $opt)
 {
     $c1 = '';
     if ($opt->short && $opt->long) {
         $c1 = sprintf('-%s, --%s', $opt->short, $opt->long);
     } elseif ($opt->short) {
         $c1 = sprintf('-%s', $opt->short);
     } elseif ($opt->long) {
         $c1 = sprintf('--%s', $opt->long);
     }
     $c1 .= $opt->renderValueHint();
     return $c1;
 }