/** * Define input definition for peridot */ public function __construct() { parent::__construct([]); $this->addArgument(new InputArgument('path', InputArgument::OPTIONAL, 'The path to a directory or file containing specs')); $this->addOption(new InputOption('grep', 'g', InputOption::VALUE_REQUIRED, 'Run tests matching <pattern> <comment>(default: *.spec.php)</comment>')); $this->addOption(new InputOption('no-colors', 'C', InputOption::VALUE_NONE, 'Disable output colors')); $this->addOption(new InputOption('reporter', 'r', InputOption::VALUE_REQUIRED, 'Select which reporter to use <comment>(default: spec)</comment>')); $this->addOption(new InputOption('bail', 'b', InputOption::VALUE_NONE, 'Stop on failure')); $this->addOption(new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'A php file containing peridot configuration')); $this->addOption(new InputOption('reporters', null, InputOption::VALUE_NONE, 'List all available reporters')); $this->addOption(new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display the Peridot version number')); $this->addOption(new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.')); }
/** * Creates a new adapter. * * @param ArgsFormat $format The adapted format. */ public function __construct(ArgsFormat $format) { parent::__construct(); $i = 1; foreach ($format->getCommandNames() as $commandName) { do { $argName = 'cmd' . $i++; } while ($format->hasArgument($argName)); $this->addArgument($argument = $this->adaptCommandName($commandName, $argName)); $this->commandNames[$argument->getName()] = $commandName; } foreach ($format->getCommandOptions() as $commandOption) { $this->addOption($this->adaptCommandOption($commandOption)); } foreach ($format->getOptions() as $option) { $this->addOption($this->adaptOption($option)); } foreach ($format->getArguments() as $argument) { $this->addArgument($this->adaptArgument($argument)); } }
/** * Initializing and building parent symfony/console InputDefinition */ public function __construct() { parent::__construct(array(new InputOption("file", "f", InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED), new InputOption("directory", "d", InputOption::VALUE_REQUIRED), new InputOption("verbose", "v", InputOption::VALUE_NONE), new InputOption("modified", null, InputOption::VALUE_NONE), new InputOption("pre-commit", null, InputOption::VALUE_NONE), new InputOption("diff", null, InputOption::VALUE_REQUIRED))); }
/** * Constructor */ public function __construct() { $definition = [new InputOption('root', 'r', 2, 'The application root.'), new InputOption('schema_path', 'sp', 2, 'Path to schema files (relative to root).'), new InputOption('schema_filename', 'sf', 4, 'Schema filename to be used as generation source.'), new InputOption('target_path', 'tp', 2, 'Path to save generated files (relative to root)'), new InputOption('template_path', 't', 2, 'Templates for generated files.'), new InputOption('generator_class', 'gc', 2, 'Fully namespaced generator class.'), new InputOption('converter_class', 'cc', 2, 'Fully namespaced converter class.'), new InputOption('bundle', 'b', 2, 'Name of loaded bundles(s) to generate, ex: "all" or "System" or "System:Content".'), new InputOption('model', 'm', 2, 'Name of loaded model(s) to generate, ex: "all" or "User" or "User:Role".'), new InputOption('subset', 's', 2, 'Function(s) to run, ex: "all" or "model:controller".'), new InputOption('extra', 'e', 2, 'Name of extra functions to run that are not specific to models, ex: "all".', "none"), new InputOption('prefix', 'p', 2, 'Name of routing prefix, ex: "Admin".'), new InputOption('namespace', 'n', 4, 'Namespace prefix.')]; parent::__construct($definition); }