From d300b4b47e912be298cbe2f250c662d4e0ff682b Mon Sep 17 00:00:00 2001 From: christopherm Date: Sun, 12 Nov 2006 19:53:08 +0000 Subject: 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 --- import_members.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 () { close(FH); +print "\n\nParsing members file completed. Now trying to import user data.\n\n"; + foreach (@users) { $myUser = $member{$_}; -- cgit v1.2.3