Symfony\Component\Console\Application::getDefaultInputDefinition PHP Method

getDefaultInputDefinition() protected method

Gets the default input definition.
protected getDefaultInputDefinition ( ) : Symfony\Component\Console\Input\InputDefinition
return Symfony\Component\Console\Input\InputDefinition An InputDefinition instance
    protected function getDefaultInputDefinition()
    {
        return new InputDefinition(array(new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'), new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'), new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'), new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question')));
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function getDefaultInputDefinition()
 {
     $definition = parent::getDefaultInputDefinition();
     $cwdOption = new InputOption('cwd', 'w', InputOption::VALUE_OPTIONAL, 'Current working directory');
     $definition->addOption($cwdOption);
     return $definition;
 }
All Usage Examples Of Symfony\Component\Console\Application::getDefaultInputDefinition