mageekguy\atoum\scripts\git\pusher::setArgumentHandlers PHP Method

setArgumentHandlers() protected method

protected setArgumentHandlers ( )
    protected function setArgumentHandlers()
    {
        parent::setArgumentHandlers()->addArgumentHandler(function ($script, $argument, $value) {
            $this->setForceMode(true);
        }, array('-f', '--force'), $this->locale->_('Force execution by avoiding any confirmation'))->addArgumentHandler(function ($script, $argument, $remote) {
            if (sizeof($remote) != 1) {
                throw new exceptions\logic\invalidArgument(sprintf($script->getLocale()->_('Bad usage of %s, do php %s --help for more informations'), $remote, $script->getName()));
            }
            $script->setRemote(reset($remote));
        }, array('-tr', '--to-remote'), '<string>', $this->locale->_('<string> will be used as remote'))->addArgumentHandler(function ($script, $argument, $tagFile) {
            if (sizeof($tagFile) != 1) {
                throw new exceptions\logic\invalidArgument(sprintf($script->getLocale()->_('Bad usage of %s, do php %s --help for more informations'), $argument, $script->getName()));
            }
            $script->setTagFile(reset($tagFile));
        }, array('-tf', '--tag-file'), '<path>', $this->locale->_('File <path> will be used to store last tag'))->addArgumentHandler(function ($script, $argument, $value) {
            $script->tagMajorVersion();
        }, array('-MR', '--major-release'), null, $this->locale->_('Tag a new major version'))->addArgumentHandler(function ($script, $argument, $value) {
            $script->tagMinorVersion();
        }, array('-mr', '--minor-release'), null, $this->locale->_('Tag a new minor version'))->addArgumentHandler(function ($script, $argument, $value) {
            $script->tagPatchVersion();
        }, array('-pr', '--patch-release'), null, $this->locale->_('Tag a new patch version'))->addArgumentHandler(function ($script, $argument, $value) {
            $script->tagBetaVersion();
        }, array('-B', '--beta-release'), null, $this->locale->_('Tag a new beta version'));
        return $this;
    }