git-remote-mediawiki: update tests to run with the new bin-wrapper
[gitweb.git] / contrib / mw-to-git / git-remote-mediawiki.perl
index 9ff45fd9268f28322bd5222070ca48eec8f23dac..71baf8ace8882e96eddab19e4b11448044b5190e 100755 (executable)
 
 use constant HTTP_CODE_OK => 200;
 
+if (@ARGV != 2) {
+       exit_error_usage();
+}
+
 my $remotename = $ARGV[0];
 my $url = $ARGV[1];
 
 
 ########################## Functions ##############################
 
+## error handling
+sub exit_error_usage {
+       die "ERROR: git-remote-mediawiki module was not called with a correct number of\n" .
+           "parameters\n" .
+           "You may obtain this error because you attempted to run the git-remote-mediawiki\n" .
+            "module directly.\n" .
+           "This module can be used the following way:\n" .
+           "\tgit clone mediawiki://<address of a mediawiki>\n" .
+           "Then, use git commit, push and pull as with every normal git repository.\n";
+}
+
 sub parse_command {
        my ($line) = @_;
        my @cmd = split(/ /, $line);