hasShortcut() public method

根据名称检查某个选项是否有短名称
public hasShortcut ( string $name ) : boolean
$name string 短名称
return boolean
Example #1
0
 /**
  * 添加一个短选项的值
  * @param string $shortcut 短名称
  * @param mixed  $value    值
  * @throws \RuntimeException
  */
 private function addShortOption($shortcut, $value)
 {
     if (!$this->definition->hasShortcut($shortcut)) {
         throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut));
     }
     $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value);
 }