summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-21 11:39:26 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-21 11:39:26 +0200
commit06345572c2129c1ded3e3890e44adee804d4e99b (patch)
tree0b5d5880916dbe532ba78ab06834d61d54c8414e /bin
parentfb27e29c67059ce309e55b51255ef60dc0162ebb (diff)
Code cleanup
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dthumb23
1 files changed, 12 insertions, 11 deletions
diff --git a/bin/dthumb b/bin/dthumb
index 60eba92..04dbd1c 100755
--- a/bin/dthumb
+++ b/bin/dthumb
@@ -15,8 +15,11 @@ use Time::Progress;
STDERR->autoflush(1);
my $opt = {};
-my $id = 1;
+my $id = 1;
+our $VERSION = '0.2';
+
+#<<<
GetOptions(
$opt,
qw{
@@ -31,20 +34,19 @@ GetOptions(
version|v
},
) or die("Please see perldoc -F $0\n");
-
-my $dthumb = App::Dthumb->new(%{$opt});
+#>>>
+my $dthumb = App::Dthumb->new( %{$opt} );
my $timer = Time::Progress->new();
-if ($opt->{version}) {
- say "dthumb version " . $dthumb->version();
+if ( $opt->{version} ) {
+ say "dthumb version $VERSION";
exit 0;
}
-if ($opt->{help}) {
- exec('perldoc', '-F', $0);
+if ( $opt->{help} ) {
+ exec( 'perldoc', '-F', $0 );
die("Please see 'perldoc -F $0' or 'man dthumb'\n");
}
-
$dthumb->read_directories();
$dthumb->create_files();
$dthumb->delete_old_thumbnails();
@@ -54,10 +56,9 @@ $timer->attr(
max => scalar $dthumb->get_files(),
);
-for my $file ($dthumb->get_files()) {
+for my $file ( $dthumb->get_files() ) {
print STDERR $timer->report(
- "\r\e[KCreating Thumbnails: %p done, %L elapsed, %E remaining",
- $id++,
+ "\r\e[KCreating Thumbnails: %p done, %L elapsed, %E remaining", $id++,
);
$dthumb->create_thumbnail_html($file);