summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>2006-11-12 19:53:08 +0000
committerchristopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>2006-11-12 19:53:08 +0000
commitd300b4b47e912be298cbe2f250c662d4e0ff682b (patch)
treed698175ebc000e09990aed76cbf2ee4c006cb9e0
parent599d33cb4fdb3fa61e16133e21f1f029ee9b9240 (diff)
Using ARGV[0] for $membersfile, displaying usage message if not supplied. Minor UI tweaks.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@532 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-ximport_members.pl13
1 files changed, 12 insertions, 1 deletions
diff --git a/import_members.pl b/import_members.pl
index 9cf35b96..ef8b27cb 100755
--- a/import_members.pl
+++ b/import_members.pl
@@ -38,7 +38,16 @@ if($ENV{HTTP_HOST}){
exit;
}
-my $membersfile = 'users/members';
+my $membersfile = $ARGV[0];
+
+if (length($membersfile) < 2){
+
+ print "\nUsage: import_members.pl path/to/members\n\n";
+ print "You must supply the path to the members file. Default location\n";
+ print "is users/members. In this case do this:\n\n";
+ print " ./import_members.pl users/members\n\n";
+ exit;
+}
my @users = ();
@@ -84,6 +93,8 @@ while (<FH>) {
close(FH);
+print "\n\nParsing members file completed. Now trying to import user data.\n\n";
+
foreach (@users) {
$myUser = $member{$_};