From 06345572c2129c1ded3e3890e44adee804d4e99b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 21 May 2011 11:39:26 +0200 Subject: Code cleanup --- bin/dthumb | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'bin') 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); -- cgit v1.2.3