getOptionForShortcut() public method

根据短名称获取选项
public getOptionForShortcut ( string $shortcut ) : Option
$shortcut string 短名称
return Option
Exemplo n.º 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);
 }