From 828bd4a062beaea4f43b4d161803b6152e6b65b2 Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Sat, 3 Sep 2011 22:18:54 +0200 Subject: [PATCH] videosite-dl: Add -d switch for debug messages --- videosite-dl.pl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/videosite-dl.pl b/videosite-dl.pl index 7313bf5..15e1bca 100755 --- a/videosite-dl.pl +++ b/videosite-dl.pl @@ -56,8 +56,9 @@ my $m; my @g; my $bp; my $info = 0; +my $debug = 0; -GetOptions("i" => \$info); +GetOptions("i" => \$info, "d" => \$debug); # This is some dark magic to find out our real base directory, # where we hope to find our plugins. @@ -72,6 +73,14 @@ unless(@g and defined($f)) { exit 1; } +foreach (@g, $f) { + $_->setio(sub { printf(@_); print("\n"); } ); + + if ($debug) { + $_->setdebug(1); + } +} + $f->setval('FILEPATTERN', './%3$s' . $ext); foreach (@ARGV) { -- 1.8.3.1