Commit 93471341 authored by Stefan Kisdaroczi's avatar Stefan Kisdaroczi Committed by Colin Watson

Add version string and --version option

parent 6e8b6f00
debmirror (1:2.29) UNRELEASED; urgency=medium
* Add version string and --version option.
-- Stefan Kisdaroczi <skisda@gmail.com> Sun, 11 Feb 2018 21:23:30 +0000
debmirror (1:2.28) unstable; urgency=medium
* Change priority to optional, since "Priority: extra" is now deprecated.
......
......@@ -89,6 +89,10 @@ download debs and source files and only simulates cleanup.
Display a usage summary.
=item B<--version>
Print version number and exit.
=item B<-h>, B<--host>=I<remotehost>
Specify the remote host to mirror from. Defaults to I<ftp.debian.org>,
......@@ -592,6 +596,8 @@ use if $] lt "5.022", "Net::INET6Glue";
use Net::FTP;
use LWP::UserAgent;
our $version="1:2.29";
# Yeah, I use too many global variables in this program.
our $mirrordir;
our @config_files;
......@@ -703,6 +709,7 @@ my $state_cache_exptime;
my $files_cache_version = "1.0";
my $help;
my $print_version;
Getopt::Long::Configure qw(no_pass_through);
GetOptions('debug' => \$debug,
'progress|p' => \$progress,
......@@ -757,9 +764,14 @@ GetOptions('debug' => \$debug,
'retry-rsync-packages=s' => \$retry_rsync_packages,
'keyring=s' => \@keyrings,
'help' => \$help,
'version' => \$print_version,
) or usage;
usage if $help;
usage("invalid number of arguments") if $ARGV[1];
if ($print_version) {
print "debmirror $version\n";
exit(0);
}
# This parameter is so important that it is the only required parameter,
# unless specified in a configuration file.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment