summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/comirror6
-rwxr-xr-xbin/comirror-setup12
2 files changed, 18 insertions, 0 deletions
diff --git a/bin/comirror b/bin/comirror
index 378c171..726e169 100755
--- a/bin/comirror
+++ b/bin/comirror
@@ -14,6 +14,12 @@ my %state = file_to_hash('comirror.state');
my $uri = shift || $state{'uri'};
my $image_re = $conf{'image_re'};
my $exit = 1;
+my $version = '0.0-git';
+
+if ($uri ~~ ['-v', '--version']) {
+ say "comirror version $version";
+ exit 0;
+}
if (not defined $uri or not defined $image_re) {
die("last_uri or image_re not found / specified\n");
diff --git a/bin/comirror-setup b/bin/comirror-setup
index d554473..6bdbbe9 100755
--- a/bin/comirror-setup
+++ b/bin/comirror-setup
@@ -26,7 +26,14 @@ my @opts = (
'Try downloading links instead of images matching image_re first?',
0,
],
+ [
+ 'version',
+ q{},
+ undef,
+ 0,
+ ],
);
+my $version = '0.0-git';
local $| = 1;
@@ -66,6 +73,11 @@ sub parse_or_ask_options {
GetOptions($conf, map { $_->[0] . $_->[1] } @opts);
+if ($conf->{'version'}) {
+ say "comirror version $version";
+ exit 0;
+}
+
if (not -t STDOUT) {
$conf->{'batch'} = 1;
}