Cake\Upgrade\Shell\Task\BaseTask::getOptionParser PHP Method

getOptionParser() public method

Get the option parser for this shell.
public getOptionParser ( ) : Cake\Console\ConsoleOptionParser
return Cake\Console\ConsoleOptionParser
    public function getOptionParser()
    {
        return parent::getOptionParser()->addArgument('path', ['help' => 'Path to code to upgrade', 'required' => true])->addOptions(['plugin' => ['short' => 'p', 'help' => 'The plugin to update. Only the specified plugin will be updated.'], 'dry-run' => ['short' => 'd', 'help' => 'Dry run the update, no files will actually be modified.', 'boolean' => true], 'git' => ['help' => 'Perform git operations. eg. git mv instead of just moving files.', 'boolean' => true], 'namespace' => ['help' => 'Set the base namespace you want to use. Defaults to App or the plugin name.', 'default' => ''], 'exclude' => ['help' => 'Comma separated list of top level diretories to exclude.', 'default' => '']]);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Get the option parser for this shell.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     return parent::getOptionParser()->addOptions(['overwrite' => ['short' => 'o', 'boolean' => true, 'help' => 'Overwrite files even if they already exist.']]);
 }
All Usage Examples Of Cake\Upgrade\Shell\Task\BaseTask::getOptionParser