Ori.livneh has submitted this change and it was merged.
Change subject: Make mwrepl a little more user friendly
......................................................................
Make mwrepl a little more user friendly
mwrepl isn't the most obvious script to use, it only tells you about
it's usage if you give it 2+ arguments. Adjust mwrepl so passing
anything prefixed with -, like someone trying -h or --help, along with
passing an unknown wiki, provide the usage.
Change-Id: I4f6806c0b53fe3cb7999f777389e28e08d3c7596
---
M modules/mediawiki/files/mwrepl
1 file changed, 6 insertions(+), 0 deletions(-)
Approvals:
Ori.livneh: Verified; Looks good to me, approved
diff --git a/modules/mediawiki/files/mwrepl b/modules/mediawiki/files/mwrepl
index 0d7f1f9..625c4c2 100755
--- a/modules/mediawiki/files/mwrepl
+++ b/modules/mediawiki/files/mwrepl
@@ -23,10 +23,16 @@
usage "Too many arguments"
elif [[ $# -eq 0 ]]; then
WIKI=testwiki
+elif [ ${1:0:1} = "-" ]; then
+ usage "Unknown argument: $1"
else
WIKI=$1
fi
+if ! expanddblist all | grep "^${WIKI}\$" > /dev/null; then
+ usage "Unknown wiki: $WIKI"
+fi
+
if [ "$(whoami)" != "$MEDIAWIKI_WEB_USER" ] ; then
HPHPD_INI="${HPHPD_INI_DIR:=/var/lib/hphpd}/$(whoami).hphpd.ini"
if [ ! -f "$HPHPD_INI" ]; then
--
To view, visit https://gerrit.wikimedia.org/r/283604
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4f6806c0b53fe3cb7999f777389e28e08d3c7596
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits