Skip to content
Permalink
Browse files

Replacing param --locations by boolean flag --no-location

  • Loading branch information...
wnasich committed Jul 13, 2015
1 parent 06b8cb0 commit 80896cef2a60e797c584d8fe33eb4c2a90889e21
@@ -48,13 +48,6 @@ class ExtractTask extends AppShell {
*/
protected $_merge = false;
/**
* Write lines with locations of each message string
*
* @var bool
*/
protected $_locations = true;
/**
* Current file being processed
*
@@ -231,10 +224,6 @@ public function execute() {
$this->_merge = strtolower($response) === 'y';
}
if (isset($this->params['locations'])) {
$this->_locations = !(strtolower($this->params['locations']) === 'no');
}
if (empty($this->_files)) {
$this->_searchFiles();
}
@@ -327,9 +316,10 @@ public function getOptionParser() {
))->addOption('merge', array(
'help' => __d('cake_console', 'Merge all domain and category strings into the default.po file.'),
'choices' => array('yes', 'no')
))->addOption('locations', array(
'help' => __d('cake_console', 'Write lines with locations of each message string'),
'choices' => array('yes', 'no')
))->addOption('no-location', array(
'boolean' => true,
'default' => false,
'help' => __d('cake_console', 'Do not write lines with locations'),
))->addOption('output', array(
'help' => __d('cake_console', 'Full path to output directory.')
))->addOption('files', array(
@@ -587,7 +577,7 @@ protected function _buildFiles() {
foreach ($contexts as $context => $details) {
$plural = $details['msgid_plural'];
$header = '';
if ($this->_locations) {
if (empty($this->params['no-location'])) {
$files = $details['references'];
$occurrences = array();
foreach ($files as $file => $lines) {
@@ -233,7 +233,7 @@ public function testExtractWithoutLocations() {
$this->Task->params['output'] = $this->path . DS;
$this->Task->params['extract-core'] = 'no';
$this->Task->params['merge'] = 'no';
$this->Task->params['locations'] = 'no';
$this->Task->params['no-location'] = true;
$this->Task->expects($this->never())->method('err');
$this->Task->expects($this->any())->method('in')

0 comments on commit 80896ce

Please sign in to comment.
You can’t perform that action at this time.