summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git/git-remote-mediawiki.perl
diff options
context:
space:
mode:
authorCélestin Matte <celestin.matte@ensimag.fr>2013-06-14 13:50:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-14 16:02:18 (GMT)
commitd8e7c67e13e0687ba01ea53522db2615ea897f96 (patch)
tree30a0cc9aa35a64e0a51b9f4dda5d0e82cb163390 /contrib/mw-to-git/git-remote-mediawiki.perl
parente3e7d34513a8802ab936bf9047f142c9aa1a6e5a (diff)
downloadgit-d8e7c67e13e0687ba01ea53522db2615ea897f96.zip
git-d8e7c67e13e0687ba01ea53522db2615ea897f96.tar.gz
git-d8e7c67e13e0687ba01ea53522db2615ea897f96.tar.bz2
git-remote-mediawiki: make error message more precise
In subroutine parse_command, error messages were not correct. For the "import" function, having too much or incorrect arguments displayed both "invalid arguments", while it displayed "too many arguments" for the "option" functions under the same conditions. Separate the two error messages in both cases. Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/mw-to-git/git-remote-mediawiki.perl')
-rwxr-xr-xcontrib/mw-to-git/git-remote-mediawiki.perl10
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index 2246c84..9ff45fd 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -161,12 +161,16 @@ sub parse_command {
die("Too many arguments for list\n") if (defined($cmd[2]));
mw_list($cmd[1]);
} elsif ($cmd[0] eq 'import') {
- die("Invalid arguments for import\n")
- if ($cmd[1] eq EMPTY || defined($cmd[2]));
+ die("Invalid argument for import\n")
+ if ($cmd[1] eq EMPTY);
+ die("Too many arguments for import\n")
+ if (defined($cmd[2]));
mw_import($cmd[1]);
} elsif ($cmd[0] eq 'option') {
+ die("Invalid arguments for option\n")
+ if ($cmd[1] eq EMPTY || $cmd[2] eq EMPTY);
die("Too many arguments for option\n")
- if ($cmd[1] eq EMPTY || $cmd[2] eq EMPTY || defined($cmd[3]));
+ if (defined($cmd[3]));
mw_option($cmd[1],$cmd[2]);
} elsif ($cmd[0] eq 'push') {
mw_push($cmd[1]);