diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-05-21 11:39:26 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-05-21 11:39:26 +0200 |
commit | 06345572c2129c1ded3e3890e44adee804d4e99b (patch) | |
tree | 0b5d5880916dbe532ba78ab06834d61d54c8414e /bin | |
parent | fb27e29c67059ce309e55b51255ef60dc0162ebb (diff) |
Code cleanup
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/dthumb | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -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); |