예제 #1
0
 /**
  * Build the option arrays that could be used with getopt()
  *
  * @return array
  */
 private function buildOptions()
 {
     $short_prefixes = $this->filter->withShortPrefix();
     $long_prefixes = $this->filter->withLongPrefix();
     $short = '';
     $long = array();
     foreach ($short_prefixes as $argument) {
         $short .= $argument->prefix;
         $short .= $argument->required == true ? ':' : '::';
     }
     foreach ($long_prefixes as $argument) {
         $rule = $argument->longPrefix;
         $rule .= $argument->required == true ? ':' : '::';
         $long[] = $rule;
     }
     return [$short, $long];
 }