Qual: Better help in perl script
This commit is contained in:
parent
1211763d53
commit
8f62565aae
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
# Copyright (C) 2003 Jean-Louis BERGAMO <jlb@j1b.org>
|
# Copyright (C) 2003 Jean-Louis BERGAMO <jlb@j1b.org>
|
||||||
|
# Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -15,10 +16,10 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
# ce script prend l'intergralite des adherents valide et les mets dans
|
# This script build a file with format
|
||||||
# une mailing-liste. ce script est utilie si l'on souhaite avoir une
|
# login:password
|
||||||
# mailing-liste avec uniquement les adherents valides.
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
use DBI;
|
use DBI;
|
||||||
use strict;
|
use strict;
|
||||||
@ -33,8 +34,8 @@ if (defined $optctl{'help'}){
|
|||||||
&usage();
|
&usage();
|
||||||
}
|
}
|
||||||
my $host=$optctl{'host'}||'localhost';
|
my $host=$optctl{'host'}||'localhost';
|
||||||
my $dbname=$optctl{'db'}||'dolibarr';
|
my $dbname=$optctl{'db'}||&usage();
|
||||||
my $user=$optctl{'user'}||'dolibarr';
|
my $user=$optctl{'user'}||&usage();
|
||||||
my $pass=$optctl{'pass'}||'';
|
my $pass=$optctl{'pass'}||'';
|
||||||
my $type=$optctl{'type'}||'mysql';
|
my $type=$optctl{'type'}||'mysql';
|
||||||
#my $ml=$optctl{'ml'}||&usage();
|
#my $ml=$optctl{'ml'}||&usage();
|
||||||
@ -64,8 +65,9 @@ while (my @row = $sth->fetchrow_array ){
|
|||||||
$dbh->disconnect();
|
$dbh->disconnect();
|
||||||
|
|
||||||
sub usage{
|
sub usage{
|
||||||
print "$0 [--help] [--host] [--db] [--user] [--pass] [--cotis] [--crypt]\n";
|
print "Usage: $0 --db=database --user=user --pass=password [--help] [--host=host] [--cotis] [--crypt]\n";
|
||||||
print " cotis : select only adherents with cotisations up-to-date\n";
|
print " --cotis : select only adherents with cotisations up-to-date\n";
|
||||||
|
print " --crypt : password is encrypted\n";
|
||||||
print "\n";
|
print "\n";
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user