Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/89778
Change subject: Consistency updates for commandline scripts
......................................................................
Consistency updates for commandline scripts
Change-Id: Ibdf353456e42570a0cb4f00e84329d083e0b06eb
---
M scripts/createCheckIndex.php
M scripts/groupStatistics.php
M scripts/languageeditstats.php
M scripts/magic-export.php
M scripts/migrate-schema2.php
M scripts/mwcore-export.php
M scripts/poimport.php
M scripts/populateFuzzy.php
M scripts/processMessageChanges.php
M scripts/refresh-translatable-pages.php
M scripts/ttmserver-export.php
M scripts/yaml-tests.php
12 files changed, 46 insertions(+), 32 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate
refs/changes/78/89778/1
diff --git a/scripts/createCheckIndex.php b/scripts/createCheckIndex.php
index 8ce7006..a2c3ac8 100644
--- a/scripts/createCheckIndex.php
+++ b/scripts/createCheckIndex.php
@@ -25,7 +25,7 @@
'checking for problems.';
$this->addOption(
'group',
- 'Comma separated list of group IDs to process (can use
* as wildcard). ' .
+ '(optional) Comma separated list of group IDs to
process (can use * as wildcard). ' .
'Default: "*"',
false, /*required*/
true /*has arg*/
diff --git a/scripts/groupStatistics.php b/scripts/groupStatistics.php
index 3bc225b..776379c 100644
--- a/scripts/groupStatistics.php
+++ b/scripts/groupStatistics.php
@@ -191,7 +191,7 @@
public function __construct() {
parent::__construct();
$this->mDescription = 'Script to generate statistics about the
localisation ' .
- 'level of one or more message groups';
+ 'level of one or more message groups.';
$this->addOption(
'groups',
'(optional) Comma separated list of groups',
diff --git a/scripts/languageeditstats.php b/scripts/languageeditstats.php
index 5ef33db..f1c0d92 100644
--- a/scripts/languageeditstats.php
+++ b/scripts/languageeditstats.php
@@ -22,7 +22,7 @@
class LanguageEditStats extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Script to show number of edits per
language for all message groups';
+ $this->mDescription = 'Script to show number of edits per
language for all message groups.';
$this->addOption(
'(optional) Show given number of language codes
(default: 10)',
'top',
diff --git a/scripts/magic-export.php b/scripts/magic-export.php
index fc77358..1c4327a 100644
--- a/scripts/magic-export.php
+++ b/scripts/magic-export.php
@@ -23,9 +23,19 @@
public function __construct() {
parent::__construct();
-
- $this->addOption( 'target', 'Target directory for exported
files', true, true );
- $this->addOption( 'type', 'magic or special', true, true );
+ $this->mDescription = 'Export of aliases and magic words for
MediaWiki extensions.';
+ $this->addOption(
+ 'target',
+ 'Target directory for exported files',
+ true, /*required*/
+ true /*has arg*/
+ );
+ $this->addOption(
+ 'type',
+ 'magic or special',
+ true, /*required*/
+ true /*has arg*/
+ );
}
public function execute() {
@@ -37,7 +47,7 @@
case 'magic':
break;
default:
- die( 'Invalid type.' );
+ $this->error( 'Invalid type.', 1 );
}
$this->openHandles();
@@ -99,12 +109,12 @@
$this->messagesOld[$group->getId()] = $specialPageAliases;
unset( $specialPageAliases );
} else {
- die( "File '$inFile' does not
contain an aliases array.\n" );
+ $this->error( "File '$inFile'
does not contain an aliases array.", 1 );
}
break;
case 'magic':
if ( !isset( $magicWords ) ) {
- die( "File '$inFile' does not
contain a magic words array.\n" );
+ $this->error( "File '$inFile'
does not contain a magic words array.", 1 );
}
$this->messagesOld[$group->getId()] =
$magicWords;
unset( $magicWords );
diff --git a/scripts/migrate-schema2.php b/scripts/migrate-schema2.php
index e0d4fb2..80b8bef 100644
--- a/scripts/migrate-schema2.php
+++ b/scripts/migrate-schema2.php
@@ -26,28 +26,22 @@
public function __construct() {
parent::__construct();
- $this->mDescription = 'Migrates db schema to version 2.';
+ $this->mDescription = 'Migrates database schema to version 2.';
}
public function execute() {
$dbw = wfGetDB( DB_MASTER );
if ( !$dbw->tableExists( 'revtag' ) ) {
- $this->error( "Table revtag doesn't exist. Translate
extension is not installed?" );
-
- return;
+ $this->error( "Table revtag doesn't exist. Translate
extension is not installed?", 1 );
}
if ( !$dbw->tableExists( 'revtag_type' ) ) {
- $this->error( "Table revtag_type doesn't exist.
Migration is already done." );
-
- return;
+ $this->error( "Table revtag_type doesn't exist.
Migration is already done.", 1 );
}
if ( $dbw->getType() !== 'mysql' ) {
$this->error( "This migration script only supports
mysql. Please help " .
- "us to write routine for {$dbw->getType()}." );
-
- return;
+ "us to write routine for {$dbw->getType()}.", 1
);
}
$table = $dbw->tableName( 'revtag' );
diff --git a/scripts/mwcore-export.php b/scripts/mwcore-export.php
index bc7b69b..737f52e 100644
--- a/scripts/mwcore-export.php
+++ b/scripts/mwcore-export.php
@@ -21,7 +21,7 @@
class MwCoreExport extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Core special features exporter';
+ $this->mDescription = 'Core special features exporter.';
$this->addOption(
'target',
'Target directory for exported files',
@@ -30,7 +30,7 @@
);
$this->addOption(
'lang',
- 'Comma separated list of language codes. Default: *',
+ '(optional) Comma separated list of language codes.
Default: *',
false, /*required*/
true /*has arg*/
);
diff --git a/scripts/poimport.php b/scripts/poimport.php
index 72eb9d7..56d67f5 100644
--- a/scripts/poimport.php
+++ b/scripts/poimport.php
@@ -21,7 +21,7 @@
class PoImport extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Po file importer (does not make changes
unless specified)';
+ $this->mDescription = 'Po file importer (does not make changes
unless specified).';
$this->addOption(
'file',
'Gettext file to import (Translate specific
formatting)',
@@ -36,7 +36,7 @@
);
$this->addOption(
'really',
- 'Actually make changes',
+ '(optional) Actually make changes',
false, /*required*/
false /*has arg*/
);
diff --git a/scripts/populateFuzzy.php b/scripts/populateFuzzy.php
index 19108f5..0f7fbf6 100644
--- a/scripts/populateFuzzy.php
+++ b/scripts/populateFuzzy.php
@@ -22,7 +22,12 @@
public function __construct() {
parent::__construct();
$this->mDescription = 'A script to populate fuzzy tags to
revtag table.';
- $this->addOption( 'namespace', 'Namepace name or id',
/*required*/false, /*has arg*/true );
+ $this->addOption(
+ 'namespace',
+ '(optional) Namepace name or id',
+ /*required*/false,
+ /*has arg*/true
+ );
}
public function execute() {
diff --git a/scripts/processMessageChanges.php
b/scripts/processMessageChanges.php
index 57928c6..396997b 100644
--- a/scripts/processMessageChanges.php
+++ b/scripts/processMessageChanges.php
@@ -40,15 +40,15 @@
$this->mDescription = 'Script for processing message changes in
file based message groups';
$this->addOption(
'group',
- 'Comma separated list of group IDs to process (can use
* as wildcard). ' .
+ '(optional) Comma separated list of group IDs to
process (can use * as wildcard). ' .
'Default: "*"',
false, /*required*/
true /*has arg*/
);
$this->addOption(
'skipgroup',
- 'Comma separated list of group IDs to not process (can
use * as wildcard). ' .
- 'Overrides --group parameter. Default: "*"',
+ '(optional) Comma separated list of group IDs to not
process (can use * ' .
+ 'as wildcard). Overrides --group parameter.',
false, /*required*/
true /*has arg*/
);
diff --git a/scripts/refresh-translatable-pages.php
b/scripts/refresh-translatable-pages.php
index c12bf1f..37021e1 100644
--- a/scripts/refresh-translatable-pages.php
+++ b/scripts/refresh-translatable-pages.php
@@ -23,7 +23,7 @@
class RefreshTranslatablePages extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Ensure all translation pages are up to
date';
+ $this->mDescription = 'Ensure all translation pages are up to
date.';
}
public function execute() {
diff --git a/scripts/ttmserver-export.php b/scripts/ttmserver-export.php
index 667dc5d..4972d82 100644
--- a/scripts/ttmserver-export.php
+++ b/scripts/ttmserver-export.php
@@ -26,11 +26,16 @@
public function __construct() {
parent::__construct();
- $this->mDescription = 'Script to bootstrap TTMServer';
- $this->addOption( 'threads', 'Number of threads',
/*required*/false, /*has arg*/true );
+ $this->mDescription = 'Script to bootstrap TTMServer.';
+ $this->addOption(
+ 'threads',
+ '(optional) Number of threads',
+ /*required*/false,
+ /*has arg*/true
+ );
$this->addOption(
'ttmserver',
- 'Server configuration identifier',
+ '(optional) Server configuration identifier',
/*required*/false,
/*has arg*/true
);
diff --git a/scripts/yaml-tests.php b/scripts/yaml-tests.php
index ca56bd6..c52cc25 100644
--- a/scripts/yaml-tests.php
+++ b/scripts/yaml-tests.php
@@ -21,7 +21,7 @@
class YamlTests extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = 'Script for comparing supported YAML
parser implementations';
+ $this->mDescription = 'Script for comparing supported YAML
parser implementations.';
}
public function execute() {
--
To view, visit https://gerrit.wikimedia.org/r/89778
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibdf353456e42570a0cb4f00e84329d083e0b06eb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits