| Server IP : 37.9.174.138 / Your IP : 216.73.216.117 Web Server : Apache System : Linux vps6.backend.sk 6.12.100+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.100-1 (2026-07-30) x86_64 User : ftpuser ( 1001) PHP Version : 8.4.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/perl5/BackupManager/ |
Upload File : |
#!/usr/bin/perl
package BackupManager::Config;
=head1 NAME
BackupManager::Config - BackupManager's configuration module
=head1 DESCRIPTION
Basically, it's a Getopt wrapper and a conffile reader.
=cut
use strict;
use warnings;
=head1 FUNCTIONS
=head2 getopt()
Comes from debconf, thanks joeyh ;)
first arg : $usage (text to be written on STDERR if help is needed).
@_ : GetOpt args.
=cut
our $usage;
sub getopt ($@) {
my ($_usage, @args) = (@_);
$usage = $_usage;
my $showusage=sub { # closure
print STDERR $_usage."\n";
exit 1;
};
# don't load big Getopt::Long unless really necessary.
return unless grep { $_ =~ /^-/ } @ARGV;
require Getopt::Long;
Getopt::Long::GetOptions(
'help|h', $showusage,
@args,
) || $showusage->();
}
=head1 AUTHOR
Alexis Sukrieh <sukria@sukria.net>
=cut
1;