diff options
author | Florian Pritz <bluewind@xinu.at> | 2017-06-11 16:12:47 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-06-11 16:22:56 +0200 |
commit | 7501d4d563e38bd7da442f69271ab28a48a46ee3 (patch) | |
tree | cc2dd11d8f810e1cfaac49503e884395bb70783d /script | |
parent | c50d8143a770178426fdadf6c19cc4573869129b (diff) | |
download | App-BorgRestore-7501d4d563e38bd7da442f69271ab28a48a46ee3.tar.gz App-BorgRestore-7501d4d563e38bd7da442f69271ab28a48a46ee3.tar.xz |
Add --version option
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'script')
-rwxr-xr-x | script/borg-restore.pl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/script/borg-restore.pl b/script/borg-restore.pl index f6299ca..0987c33 100755 --- a/script/borg-restore.pl +++ b/script/borg-restore.pl @@ -93,6 +93,10 @@ yet and you want to restore a file without having to manually call borg extract. Using this option will show all archives that borg knows about, even if they do not contain the file that shall be restored. +=item B<--version> + +Output the program version. + =back =head1 CONFIGURATION @@ -206,9 +210,14 @@ sub main { $ENV{PATH} = App::BorgRestore::Helper::untaint($ENV{PATH}, qr(.*)); Getopt::Long::Configure ("bundling"); - GetOptions(\%opts, "help|h", "debug", "update-cache|u", "destination|d=s", "time|t=s", "adhoc") or pod2usage(2); + GetOptions(\%opts, "help|h", "debug", "update-cache|u", "destination|d=s", "time|t=s", "adhoc", "version") or pod2usage(2); pod2usage(0) if $opts{help}; + if ($opts{version}) { + printf "Version: %s\n", $App::BorgRestore::VERSION; + return 0; + } + pod2usage(-verbose => 0) if (@ARGV== 0 and !$opts{"update-cache"}); if ($opts{debug}) { |