getOptionParser() публичный метод

By overriding this method you can configure the ConsoleOptionParser before returning it.
public getOptionParser ( ) : Cake\Console\ConsoleOptionParser
Результат Cake\Console\ConsoleOptionParser
Пример #1
7
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description('Asset Management for CakePHP.');
     foreach ($this->_taskMap as $task => $config) {
         $taskParser = $this->{$task}->getOptionParser();
         $parser->addSubcommand(Inflector::underscore($task), ['help' => $taskParser->description(), 'parser' => $taskParser]);
     }
     return $parser;
 }
 /**
  * main() method.
  *
  * @return bool|int Success or error code.
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addSubcommand('initialize', ['help' => 'Execute The Initialize-method. This will add some important data to your database.', 'parser' => $this->Initialize->getOptionParser()]);
     $parser->addSubcommand('user', ['help' => 'Execute The User-task. You will be able to create an user.', 'parser' => $this->User->getOptionParser()]);
     return $parser;
 }
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addOption('adapter', ['short' => 'a', 'help' => __('The adapter config name to use.'), 'default' => 'Local']);
     $parser->addOption('model', ['short' => 'm', 'help' => __('The model / table to use.'), 'default' => 'Burzum/FileStorage.FileStorage']);
     $parser->addSubcommand('image', ['help' => __('Image Processing Task.'), 'parser' => $this->Image->getOptionParser()]);
     $parser->addSubcommand('store', ['help' => __('Stores a file in the DB.')]);
     return $parser;
 }
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addOption('config', ['default' => 'default', 'help' => 'Name of a queue config to use', 'short' => 'c']);
     $parser->addOption('queue', ['help' => 'Name of queue to override from loaded config', 'short' => 'Q']);
     $parser->addOption('logger', ['help' => 'Name of a configured logger', 'default' => 'stdout', 'short' => 'l']);
     $parser->addOption('worker', ['choices' => ['Sequential', 'Test'], 'default' => 'Sequential', 'help' => 'Name of worker class', 'short' => 'w'])->description(__('Runs a Queuesadilla worker.'));
     return $parser;
 }
Пример #5
6
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description('CakePHP Language String Extraction:')->addOption('app', ['help' => 'Directory where your application is located.'])->addOption('paths', ['help' => 'Comma separated list of paths.'])->addOption('merge', ['help' => 'Merge all domain strings into the default.po file.', 'choices' => ['yes', 'no']])->addOption('output', ['help' => 'Full path to output directory.'])->addOption('files', ['help' => 'Comma separated list of files.'])->addOption('exclude-plugins', ['boolean' => true, 'default' => true, 'help' => 'Ignores all files in plugins if this command is run inside from the same app directory.'])->addOption('plugin', ['help' => 'Extracts tokens only from the plugin specified and puts the result in the plugin\'s Locale directory.'])->addOption('ignore-model-validation', ['boolean' => true, 'default' => false, 'help' => 'Ignores validation messages in the $validate property.' . ' If this flag is not set and the command is run from the same app directory,' . ' all messages in model validation rules will be extracted as tokens.'])->addOption('validation-domain', ['help' => 'If set to a value, the localization domain to be used for model validation messages.'])->addOption('exclude', ['help' => 'Comma separated list of directories to exclude.' . ' Any path containing a path segment with the provided values will be skipped. E.g. test,vendors'])->addOption('overwrite', ['boolean' => true, 'default' => false, 'help' => 'Always overwrite existing .pot files.'])->addOption('extract-core', ['help' => 'Extract messages from the CakePHP core libs.', 'choices' => ['yes', 'no']])->addOption('no-location', ['boolean' => true, 'default' => false, 'help' => 'Do not write file locations for each extracted message.']);
     return $parser;
 }
 /**
  * getOptionParser method
  *
  * @return $parser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $this->_io->styles('green_text', ['text' => 'green', 'blink' => true]);
     $this->_io->styles('red_text', ['text' => 'red', 'blink' => true]);
     $this->_io->styles('blue_text', ['text' => 'blue', 'blink' => true]);
     $parser->addSubcommand('start_caching', ['help' => 'Cache and optimize original image in plugin webroot cache folder', 'parser' => ['description' => [__("<warning>This subcommand uses for cache and optimize all images from "), __("source folder to cache folder. Cache options gets from "), __("adaptive_image_config.php in /config dir. You also can "), __("disable image optimization if argument 'optimization' = false. "), __("If cache folder already exists - all images will be recached. </warning>")], 'arguments' => ['optimization' => ['help' => __('Enable\\Disable image optimization; boolean; <blue_text>(default: true)</blue_text>'), 'required' => false], 'src_path' => ['help' => __('Folder for source images, root is : /webroot/img/. <blue_text>(default: \'src_images\')</blue_text>'), 'required' => false]]]]);
     $parser->addSubcommand('clear_cache', ['help' => 'Remove cache folder', 'parser' => ['description' => [__("<warning>Remove cache folder with cached images</warning>")]]]);
     $parser->addSubcommand('check_for_img_tags', ['help' => 'Show places in code, where don\'t uses AdaptiveImgHelper for images; Search in /src dir', 'parser' => ['description' => [__("<warning>Show places in code, where don't uses AdaptiveImgHelper for images; Search in /src dir</warning>")]]]);
     return $parser;
 }
Пример #7
4
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addOption('engine', ['choices' => ['Beanstalk', 'Iron', 'Memory', 'Mysql', 'Null', 'Redis', 'Synchronous'], 'default' => 'Mysql', 'help' => 'Name of engine', 'short' => 'e']);
     $parser->addOption('queue', ['help' => 'Name of a queue', 'short' => 'q']);
     $parser->addOption('logger', ['help' => 'Name of a configured logger', 'default' => 'stdout', 'short' => 'l']);
     $parser->addOption('worker', ['choices' => ['Sequential', 'Test'], 'default' => 'Sequential', 'help' => 'Name of worker class', 'short' => 'w'])->description(__('Runs a Queuesadilla worker.'));
     return $parser;
 }
Пример #8
3
 /**
  * Get option parser.
  *
  * @return \Cake\Console\OptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__d('debug_kit', 'Allows you to obtain some rough benchmarking statistics' . 'about a fully qualified URL.'))->addArgument('url', ['help' => __d('debug_kit', 'The URL to request.'), 'required' => true])->addOption('n', ['default' => 10, 'help' => __d('debug_kit', 'Number of iterations to perform.')])->addOption('t', ['default' => 100, 'help' => __d('debug_kit', 'Maximum total time for all iterations, in seconds.' . 'If a single iteration takes more than the timeout, only one request will be made')])->epilog(__d('debug_kit', 'Example Use: `cake benchmark --n 10 --t 100 http://localhost/testsite`. ' . '<info>Note:</info> this benchmark does not include browser render times.'));
     return $parser;
 }
Пример #9
3
 /**
  * Get the option parser instance and configures it.
  *
  * @return ConsoleOptionParser
  * @see Shell::getOptionParser()
  */
 public function getOptionParser()
 {
     $startParserArguments = ['options' => ['user' => ['short' => 'u', 'help' => __d('cake_resque', 'User running the workers')], 'queue' => ['short' => 'q', 'help' => __d('cake_resque', 'Name of the queue. If multiple queues, separe with comma.')], 'interval' => ['short' => 'i', 'help' => __d('cake_resque', 'Pause time in seconds between each works')], 'workers' => ['short' => 'n', 'help' => __d('cake_resque', 'Number of workers to fork')], 'log' => ['short' => 'l', 'help' => __d('cake_resque', 'Log path')], 'log-handler' => ['help' => __d('cake_resque', 'Log Handler to use for logging.')], 'log-handler-target' => ['help' => __d('cake_resque', 'Log Handler arguments')], 'verbose' => ['short' => 'v', 'help' => __d('cake_resque', 'Log more verbose informations'), 'boolean' => true], 'debug' => ['short' => 'd', 'help' => __d('cake_resque', 'Print debug informations'), 'boolean' => true]]];
     $startSchedulerParserArguments = ['options' => ['user' => ['short' => 'u', 'help' => __d('cake_resque', 'User running the workers')], 'interval' => ['short' => 'i', 'help' => __d('cake_resque', 'Pause time in seconds between each works')], 'log' => ['short' => 'l', 'help' => __d('cake_resque', 'Log path')], 'log-handler' => ['help' => __d('cake_resque', 'Log Handler to use for logging.')], 'log-handler-target' => ['help' => __d('cake_resque', 'Log Handler arguments')], 'verbose' => ['short' => 'v', 'help' => __d('cake_resque', 'Log more verbose informations'), 'boolean' => true]]];
     $stopParserArguments = ['options' => ['force' => ['short' => 'f', 'help' => __d('cake_resque', 'Force workers shutdown, forcing all the current jobs to finish (and fail)'), 'boolean' => true], 'all' => ['short' => 'a', 'help' => __d('cake_resque', 'Shutdown all workers'), 'boolean' => true]], 'description' => [__d('cake_resque', 'Stop one or all workers'), __d('cake_resque', 'Unless you force the stop with the --force option,'), __d('cake_resque', 'the worker will wait for all jobs to complete'), __d('cake_resque', 'before shutting down')]];
     $pauseParserArguments = ['options' => ['all' => ['short' => 'a', 'help' => __d('cake_resque', 'Pause all workers'), 'boolean' => true], 'debug' => ['short' => 'd', 'help' => __d('cake_resque', 'Print debug informations'), 'boolean' => true]], 'description' => [__d('cake_resque', 'Pause one or all workers'), __d('cake_resque', 'Pausing is only supported on Unix system,'), __d('cake_resque', 'with PHP pcntl extension installed')]];
     $resumeParserArguments = ['options' => ['all' => ['short' => 'a', 'help' => __d('cake_resque', 'Resume all paused workers'), 'boolean' => true], 'debug' => ['short' => 'd', 'help' => __d('cake_resque', 'Print debug informations'), 'boolean' => true]], 'description' => [__d('cake_resque', 'Resume one or all paused workers'), __d('cake_resque', 'Resuming is only supported on Unix system,'), __d('cake_resque', 'with PHP pcntl extension installed')]];
     $cleanupParserArguments = ['options' => ['all' => ['short' => 'a', 'help' => __d('cake_resque', 'Clean up all workers'), 'boolean' => true], 'debug' => ['short' => 'd', 'help' => __d('cake_resque', 'Print debug informations'), 'boolean' => true]], 'description' => [__d('cake_resque', 'Cleaning Up one or all paused workers'), __d('cake_resque', 'Cleaning Up will immedately terminate the job'), __d('cake_resque', 'the worker is currently working on.'), __d('cake_resque', 'Resuming is only supported on Unix system,'), __d('cake_resque', 'with PHP pcntl extension installed')]];
     $clearParserArguments = ['options' => ['all' => ['short' => 'a', 'help' => __d('cake_resque', 'Clear all queues'), 'boolean' => true], 'debug' => ['short' => 'd', 'help' => __d('cake_resque', 'Print debug informations'), 'boolean' => true]], 'description' => [__d('cake_resque', 'Clear one or all queues'), __d('cake_resque', 'Clearing a queue will remove all its jobs')]];
     return parent::getOptionParser()->description(__d('cake_resque', "A Shell to manage PHP Resque") . "\n" . __d('cake_resque', "Version " . CakeResqueShell::VERSION) . "\n" . "Wan Chen (" . date('Y') . ")")->addSubcommand('start', ['help' => __d('cake_resque', 'Start a new worker.'), 'parser' => $startParserArguments])->addSubcommand('startscheduler', ['help' => __d('cake_resque', 'Start a new scheduler worker.'), 'parser' => $startSchedulerParserArguments])->addSubcommand('stop', ['help' => __d('cake_resque', 'Stop a worker.'), 'parser' => $stopParserArguments])->addSubcommand('pause', ['help' => __d('cake_resque', 'Pause a worker.'), 'parser' => $pauseParserArguments])->addSubcommand('resume', ['help' => __d('cake_resque', 'Resume a paused worker.'), 'parser' => $resumeParserArguments])->addSubcommand('cleanup', ['help' => __d('cake_resque', 'Immediately terminate a worker job execution.'), 'parser' => $cleanupParserArguments])->addSubcommand('restart', ['help' => __d('cake_resque', 'Stop all Resque workers, and start a new one.'), 'parser' => array_merge_recursive($startParserArguments, $stopParserArguments)])->addSubcommand('clear', ['help' => __d('cake_resque', 'Clear all jobs inside a queue'), 'parser' => $clearParserArguments])->addSubcommand('reset', ['help' => __d('cake_resque', 'Reset CakeResque internal worker\'s saved status'), 'parser' => $clearParserArguments])->addSubcommand('stats', ['help' => __d('cake_resque', 'View stats about processed/failed jobs.')])->addSubcommand('tail', ['help' => __d('cake_resque', 'Tail the workers logs.')])->addSubcommand('track', ['help' => __d('cake_resque', 'Track a job status.')])->addSubcommand('load', ['help' => __d('cake_resque', 'Load a set of predefined workers.')])->addSubcommand('enqueue', ['help' => __d('cake_resque', 'Enqueue a job.')]);
 }
Пример #10
2
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $infoParser = $parser->toArray();
     $infoParser['arguments']['url'] = ['help' => 'Absolute URL', 'required' => false];
     $parser->description('Cache Shell to cleanup caching of view files.')->addSubcommand('info', ['help' => 'Infos about the files', 'parser' => $infoParser])->addSubcommand('clear', ['help' => 'Clear all or part of the files', 'parser' => $parser]);
     return $parser;
 }
Пример #11
2
 /**
  * Get the option parser for this shell.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addSubcommand('list_prefixes', ['help' => 'Show a list of all defined cache prefixes.']);
     $parser->addSubcommand('clear_all', ['help' => 'Clear all caches.']);
     $parser->addSubcommand('clear', ['help' => 'Clear the cache for a specified prefix.', 'parser' => ['description' => ['Clear the cache for a particular prefix.', 'For example, `cake cache clear _cake_model_` will clear the model cache', 'Use `cake cache list_prefixes` to list available prefixes'], 'arguments' => ['prefix' => ['help' => 'The cache prefix to be cleared.', 'required' => true]]]]);
     return $parser;
 }
 /**
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addSubcommand('cleanup', ['help' => 'Log rotation and other cleanup.']);
     $parser->addSubcommand('reset', ['help' => 'Resets the database, truncates all data. Use -q to skip confirmation.']);
     $parser->addSubcommand('test_entry', ['help' => 'Adds a test entry with a certain log type.', 'parser' => ['arguments' => ['level' => ['help' => 'The log level to use ("' . implode('", "', Log::levels()) . '"), defaults to "info"', 'required' => false], 'message' => ['help' => 'The message, defaults to "test"', 'required' => false], 'context' => ['help' => 'The scope key, defaults to none', 'required' => false]]]]);
     return $parser;
 }
 /**
  * @inheritDoc
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description([__d('file_storage', 'Shell command for generating and removing image versions.')]);
     $parser->addOption('storageTable', ['short' => 's', 'help' => __d('file_storage', 'The storage table for image processing you want to use.')]);
     $parser->addOption('limit', ['short' => 'l', 'help' => __d('file_storage', 'Limits the amount of records to be processed in one batch')]);
     $parser->addSubcommands(['generate' => ['help' => __d('file_storage', '<model> <version> Generate a new image version'), 'parser' => ['arguments' => ['model' => ['help' => __d('file_storage', 'Value of the model property of the images to generate'), 'required' => true], 'version' => ['help' => __d('file_storage', 'Image version to generate'), 'required' => true]], 'options' => ['storageTable' => ['short' => 's', 'help' => __d('file_storage', 'The storage table for image processing you want to use.')], 'limit' => ['short' => 'l', 'help' => __d('file_storage', 'Limits the amount of records to be processed in one batch')], 'keep-old-versions' => ['short' => 'k', 'help' => __d('file_storage', 'Use this switch if you do not want to overwrite existing versions.'), 'boolean' => true]]]], 'remove' => ['help' => __d('file_storage', '<model> <version> Remove an new image version'), 'parser' => ['arguments' => ['model' => ['help' => __d('file_storage', 'Value of the model property of the images to remove'), 'required' => true], 'version' => ['help' => __d('file_storage', 'Image version to remove'), 'required' => true]], 'options' => ['storageTable' => ['short' => 's', 'help' => __d('file_storage', 'The storage table for image processing you want to use.')], 'limit' => ['short' => 'l', 'help' => __d('file_storage', 'Limits the amount of records to be processed in one batch')]]]], 'regenerate' => ['help' => __d('file_storage', '<model> Generates all image versions.'), 'parser' => ['arguments' => ['model' => ['help' => __d('file_storage', 'Value of the model property of the images to generate'), 'required' => true]], 'options' => ['storageTable' => ['short' => 's', 'help' => __d('file_storage', 'The storage table for image processing you want to use.')], 'limit' => ['short' => 'l', 'help' => __d('file_storage', 'Limits the amount of records to be processed in one batch')], 'keep-old-versions' => ['short' => 'k', 'help' => __d('file_storage', 'Use this switch if you do not want to overwrite existing versions.'), 'boolean' => true]]]]]);
     return $parser;
 }
Пример #14
2
 /**
  * Get option parser method to parse commandline options
  *
  * @return OptionParser
  */
 public function getOptionParser()
 {
     $subcommandParser = ['options' => []];
     $subcommandParserFull = $subcommandParser;
     $subcommandParserFull['options']['group'] = ['short' => 'g', 'help' => 'Group', 'default' => ''];
     return parent::getOptionParser()->description("Simple and minimalistic job queue (or deferred-task) system.")->addSubcommand('clean', ['help' => 'Remove old jobs (cleanup)', 'parser' => $subcommandParser])->addSubcommand('add', ['help' => 'Add Job', 'parser' => $subcommandParser])->addSubcommand('install', ['help' => 'Install info', 'parser' => $subcommandParser])->addSubcommand('uninstall', ['help' => 'Uninstall info', 'parser' => $subcommandParser])->addSubcommand('stats', ['help' => 'Stats', 'parser' => $subcommandParserFull])->addSubcommand('reset', ['help' => 'Stats', 'parser' => $subcommandParserFull])->addSubcommand('runworker', ['help' => 'Run Worker', 'parser' => $subcommandParserFull]);
 }
Пример #15
1
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addOption('limit', ['short' => 'l', 'help' => 'how many queue records to process at once', 'default' => 20])->addOption('status', ['short' => 's', 'help' => 'only queue entities in this status will be processed', 'default' => 'pending', 'choices' => ['pending', 'failed', 'sent']])->addOption('id', ['help' => 'supply an ID to send a specific email']);
     # build a list of possible types from the config file
     $types = array_keys(Configure::read('EmailQueue.specific')) ?: [];
     $parser->addOption('type', ['short' => 't', 'help' => 'only queue entities of this type will be processed', 'choices' => $types]);
     return $parser;
 }
Пример #16
1
 /**
  * Defines what options can be passed to the shell.
  * This is required because CakePHP validates the passed options
  * and would complain if something not configured here is present
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     return parent::getOptionParser()->addOption('plugin', ['short' => 'p'])->addOption('target', ['short' => 't'])->addOption('connection', ['short' => 'c'])->addOption('source', ['short' => 's'])->addOption('seed')->addOption('ansi')->addOption('no-ansi')->addOption('version', ['short' => 'V'])->addOption('no-interaction', ['short' => 'n'])->addOption('template', ['short' => 't'])->addOption('format', ['short' => 'f'])->addOption('only', ['short' => 'o'])->addOption('exclude', ['short' => 'x']);
 }
Пример #17
1
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__d('eav', 'Select target table'))->addOption('use', ['short' => 'u', 'help' => __d('eav', 'The table alias name. e.g. "User.Users".')])->addOption('bundle', ['short' => 'b', 'help' => __d('eav', 'Indicates the column belongs to a bundle name within the table.'), 'default' => null]);
     return $parser;
 }
Пример #18
1
 /**
  *
  * @return OptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__d('Users', 'Utilities for CakeDC Users Plugin'))->addSubcommand('activateUser')->description(__d('Users', 'Activate an specific user'))->addSubcommand('addSuperuser')->description(__d('Users', 'Add a new superadmin user for testing purposes'))->addSubcommand('addUser')->description(__d('Users', 'Add a new user'))->addSubcommand('changeRole')->description(__d('Users', 'Change the role for an specific user'))->addSubcommand('deactivateUser')->description(__d('Users', 'Deactivate an specific user'))->addSubcommand('deleteUser')->description(__d('Users', 'Delete an specific user'))->addSubcommand('passwordEmail')->description(__d('Users', 'Reset the password via email'))->addSubcommand('resetAllPasswords')->description(__d('Users', 'Reset the password for all users'))->addSubcommand('resetPassword')->description(__d('Users', 'Reset the password for an specific user'))->addOptions(['username' => ['short' => 'u', 'help' => 'The username for the new user'], 'password' => ['short' => 'p', 'help' => 'The password for the new user'], 'email' => ['short' => 'e', 'help' => 'The email for the new user']]);
     return $parser;
 }
Пример #19
0
 /**
  * get the option parser
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     return $parser->addOption('path', ['short' => 'p', 'help' => __d('cake_console', 'Absolute path or relative to APP.')]);
 }
Пример #20
0
 /**
  * Get the option parser for this shell.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $plugin = ['short' => 'p', 'help' => __('Plugin to process')];
     $parser->description(__("Better manage, and easily synchronize you application's ACO tree"))->addSubcommand('aco_update', ['parser' => ['options' => compact('plugin')], 'help' => __('Add new ACOs for new controllers and actions. Does not remove nodes from the ACO table.')])->addSubcommand('aco_sync', ['parser' => ['options' => compact('plugin')], 'help' => __('Perform a full sync on the ACO table.' . 'Will create new ACOs or missing controllers and actions.' . 'Will also remove orphaned entries that no longer have a matching controller/action')])->addSubcommand('recover', ['help' => __('Recover a corrupted Tree'), 'parser' => ['arguments' => ['type' => ['required' => true, 'help' => __('The type of tree to recover'), 'choices' => ['aco', 'aro']]]]]);
     return $parser;
 }
Пример #21
0
 /**
  * Configure command line options and arguments.
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description('Provides a mechanism for loading data into any of Cake\'s configured databases.')->addSubcommand('init', ['help' => 'Initialize a new, empty seed file. Respects both the --dev and --file options.'])->addOption('dev', ['short' => 'd', 'boolean' => true, 'default' => false, 'help' => 'Use the "dev" seed file instead of the default.'])->addOption('file', ['short' => 'f', 'help' => 'Manually specify the file that should be used. When this option is present, its argument will always be used explicitly, overriding the --dev option if it is also present.']);
     return $parser;
 }
Пример #22
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(['PHP Built-in Server for CakePHP', '<warning>[WARN] Don\'t use this at the production environment</warning>'])->addOption('host', ['short' => 'H', 'help' => 'ServerHost'])->addOption('port', ['short' => 'p', 'help' => 'ListenPort'])->addOption('document_root', ['short' => 'd', 'help' => 'DocumentRoot']);
     return $parser;
 }
Пример #23
-1
 /**
  * Return the help options and validate arguments
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addSubcommand('generate', ['help' => __('Regenerate thumbnails for a specific table.'), 'parser' => ['description' => [__('Use this command to regenerate the thumbnails for a specific table.')], 'arguments' => ['table' => ['help' => __('The table to regenerate thumbs for'), 'required' => true]], 'options' => ['path-class' => ['short' => 'p', 'help' => __('Fully name spaced custom path class, you must use double backslash.')], 'image-class' => ['short' => 'i', 'help' => __('Fully name spaced custom image transform class, you must use double backslash.')]]]]);
     $parser->addSubcommand('cleanup', ['help' => __('Clean up old images on the file system which are not linked in the database.'), 'parser' => ['description' => [__('This command will delete images which are not part of the model configuration.')], 'arguments' => ['table' => ['help' => __('The table to regenerate thumbs for'), 'required' => true]], 'options' => ['dry-run' => ['short' => 'd', 'help' => __('Do a dry run and don\'t delete any files.'), 'boolean' => true]]]]);
     return $parser;
 }
Пример #24
-1
 /**
  * Get the option parser for this task.
  *
  * This base class method sets up some commonly used options.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $bakeThemes = [];
     foreach (Plugin::loaded() as $plugin) {
         $path = Plugin::classPath($plugin);
         if (is_dir($path . 'Template' . DS . 'Bake')) {
             $bakeThemes[] = $plugin;
         }
     }
     $parser->addOption('plugin', ['short' => 'p', 'help' => 'Plugin to bake into.'])->addOption('force', ['short' => 'f', 'boolean' => true, 'help' => 'Force overwriting existing files without prompting.'])->addOption('connection', ['short' => 'c', 'default' => 'default', 'help' => 'The datasource connection to get data from.'])->addOption('theme', ['short' => 't', 'help' => 'The theme to use when baking code.', 'choices' => $bakeThemes]);
     return $parser;
 }
Пример #25
-1
 /**
  * get the option parser.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     return $parser->description(['Asset Compress Shell', '', 'Builds and clears assets defined in your asset_compress.ini', 'file and in your view files.'])->addSubcommand('clear', ['help' => 'Clears all builds defined in the ini file.'])->addSubcommand('build', ['help' => 'Generate all builds defined in the ini files.'])->addOption('force', ['help' => 'Force assets to rebuild. Ignores timestamp rules.', 'short' => 'f', 'boolean' => true]);
 }
Пример #26
-1
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__d('system', 'Export database'))->addOption('destination', ['short' => 'd', 'help' => __d('system', 'Where to place the exported tables.'), 'default' => normalizePath(TMP . '/fixture/')])->addOption('tables', ['short' => 't', 'help' => __d('system', 'Optional, comma-separated list of table names to export. All tables will be exported if not provided.'), 'default' => []])->addOption('no-id', ['short' => 'n', 'help' => __d('system', 'Exclude "id" columns from records, useful for some DB driver such as Postgres.'), 'boolean' => true, 'default' => false])->addOption('fixture', ['short' => 'f', 'help' => __d('system', 'Generates Fixture classes suitable for testing environments.'), 'boolean' => true, 'default' => false])->addOption('mode', ['short' => 'm', 'help' => __d('system', 'What to export, "full" exports schema and records, or "schema" for schema only.'), 'default' => 'full', 'choices' => ['full', 'schema']])->addOption('no-data', ['short' => 'n', 'help' => __d('system', 'List of table for which do not export data (only schema).'), 'default' => []]);
     return $parser;
 }
Пример #27
-1
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     return $parser;
 }
Пример #28
-2
 /**
  * Manage the available sub-commands along with their arguments and help
  *
  * @see http://book.cakephp.org/3.0/en/console-and-shells.html#configuring-options-and-generating-help
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addSubcommand('merge', ['help' => 'Merge po file.']);
     $parser->addSubcommand('schema', ['help' => 'Generate po file from schema.']);
     return $parser;
 }
Пример #29
-2
 /**
  * Manage the available sub-commands along with their arguments and help
  *
  * @see http://book.cakephp.org/3.0/en/console-and-shells.html#configuring-options-and-generating-help
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $updateFromCatalogParser = parent::getOptionParser();
     $updateFromCatalogParser->addOption('domain', ['default' => 'default', 'help' => 'The domain to use']);
     $updateFromCatalogParser->addOption('overwrite', ['default' => false, 'help' => 'If set, there will be no interactive question whether to continue.', 'boolean' => true]);
     $updateFromCatalogParser->addOption('strip-references', ['boolean' => true, 'help' => 'Whether to remove file usage references from resulting po and mo files.']);
     return $parser->description(['CkTools Shell', '', 'Utilities'])->addSubcommand('updateFromCatalog', ['help' => 'Updates the PO file from the given catalog', 'parser' => $updateFromCatalogParser]);
     return $parser;
 }
Пример #30
-4
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description('Used by shells like bash to autocomplete command name, options and arguments')->addSubcommand('commands', ['help' => 'Output a list of available commands', 'parser' => ['description' => 'List all availables']])->addSubcommand('subcommands', ['help' => 'Output a list of available subcommands', 'parser' => ['description' => 'List subcommands for a command', 'arguments' => ['command' => ['help' => 'The command name', 'required' => false]]]])->addSubcommand('options', ['help' => 'Output a list of available options', 'parser' => ['description' => 'List options', 'arguments' => ['command' => ['help' => 'The command name', 'required' => false]]]])->addSubcommand('fuzzy', ['help' => 'Guess autocomplete'])->epilog(['This command is not intended to be called manually']);
     return $parser;
 }