EBernhardson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/283604

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/04/283604/1

diff --git a/modules/mediawiki/files/mwrepl b/modules/mediawiki/files/mwrepl
index 0d7f1f9..10c66fa 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} -eq "-" ]]; 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: newchange
Gerrit-Change-Id: I4f6806c0b53fe3cb7999f777389e28e08d3c7596
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: EBernhardson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to