summaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-02-27 14:50:47 +0100
committerFlorian Pritz <bluewind@xinu.at>2017-02-27 14:50:47 +0100
commit6875a02e7475b8288c0044795c1b77adaf213ba9 (patch)
treef51b1ad324fb29c3cd9e62bf6e06ce7961e16243 /script
parent4a3fc6e06f83a34c9ac219e31abbc6bae6cb8318 (diff)
downloadApp-BorgRestore-6875a02e7475b8288c0044795c1b77adaf213ba9.tar.gz
App-BorgRestore-6875a02e7475b8288c0044795c1b77adaf213ba9.tar.xz
Move debug() to main package
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'script')
-rwxr-xr-xscript/borg-restore.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/script/borg-restore.pl b/script/borg-restore.pl
index f586ed5..7ec23e1 100755
--- a/script/borg-restore.pl
+++ b/script/borg-restore.pl
@@ -155,6 +155,7 @@ See gpl-3.0.txt for the full license text.
use v5.10;
+use App::BorgRestore;
use App::BorgRestore::Borg;
use App::BorgRestore::DB;
use App::BorgRestore::Helper;
@@ -176,9 +177,10 @@ use Time::HiRes;
my %opts;
my %db;
+my $app;
sub debug {
- say STDERR @_ if $opts{debug};
+ $app->debug(@_);
}
sub find_archives {
@@ -541,6 +543,8 @@ sub main {
GetOptions(\%opts, "help|h", "debug", "update-cache|u", "destination|d=s", "time|t=s") or pod2usage(2);
pod2usage(0) if $opts{help};
+ $app = App::BorgRestore->new(\%opts);
+
if ($opts{"update-cache"}) {
update_cache();
return 0;