getCommandOptions() публичный Метод

Return a set of command request, converted from the Base Request
public getCommandOptions ( ) : InputOption[]
Результат InputOption[]
Пример #1
0
 protected function configure()
 {
     $this->setName('init');
     $this->setDescription('Setup a new project configuration in the current directory');
     $this->setHelp('The <comment>init</comment> interactive task can be used to setup a new project');
     // Create an information collector and configure the different information request
     $this->informationCollector = new \Liip\RMT\Information\InformationCollector();
     $this->informationCollector->registerRequests(array(new InformationRequest('vcs', array('description' => 'The VCS system to use', 'type' => 'choice', 'choices' => array('git', 'hg', 'none'), 'choices_shortcuts' => array('g' => 'git', 'h' => 'hg', 'n' => 'none'), 'default' => 'none')), new InformationRequest('persister', array('description' => 'The strategy to use to persist the current version value', 'type' => 'choice', 'choices' => array('vcs-tag', 'changelog', 'composer'), 'choices_shortcuts' => array('t' => 'vcs-tag', 'c' => 'composer', 'l' => 'changelog'), 'command_argument' => true, 'interactive' => true))));
     foreach ($this->informationCollector->getCommandOptions() as $option) {
         $this->getDefinition()->addOption($option);
     }
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 protected function configure()
 {
     $this->setName('init');
     $this->setDescription('Setup a new project configuration in the current directory');
     $this->setHelp('The <comment>init</comment> interactive task can be used to setup a new project');
     // Add an option to force re-creation of the config file
     $this->getDefinition()->addOption(new InputOption('force', null, InputOption::VALUE_NONE, 'Force update of the config file'));
     // Create an information collector and configure the different information request
     $this->informationCollector = new InformationCollector();
     $this->informationCollector->registerRequests(array(new InformationRequest('configonly', array('description' => 'if you want to skip creation of the RMT convenience script', 'type' => 'yes-no', 'command_argument' => true, 'interactive' => true, 'default' => 'n')), new InformationRequest('vcs', array('description' => 'The VCS system to use', 'type' => 'choice', 'choices' => array('git', 'hg', 'none'), 'choices_shortcuts' => array('g' => 'git', 'h' => 'hg', 'n' => 'none'), 'default' => 'none')), new InformationRequest('generator', array('description' => 'The generator to use for version incrementing', 'type' => 'choice', 'choices' => array('semantic-versioning', 'basic-increment'), 'choices_shortcuts' => array('s' => 'semantic-versioning', 'b' => 'basic-increment'))), new InformationRequest('persister', array('description' => 'The strategy to use to persist the current version value', 'type' => 'choice', 'choices' => array('vcs-tag', 'changelog'), 'choices_shortcuts' => array('t' => 'vcs-tag', 'c' => 'changelog'), 'command_argument' => true, 'interactive' => true))));
     foreach ($this->informationCollector->getCommandOptions() as $option) {
         $this->getDefinition()->addOption($option);
     }
 }