summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-02-27 16:51:34 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-02-27 16:51:34 +0100
commit1647027acdde0c71eda1b781723688f1a53c6076 (patch)
treee5be68187c49f650b205995da501c355cb2fa0a6 /lib
parent30019defd0a9a3b69f883e43b45ae686d8f0f891 (diff)
Add help/version switches
Diffstat (limited to 'lib')
-rwxr-xr-xlib/App/Dthumb.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/App/Dthumb.pm b/lib/App/Dthumb.pm
index f525776..f26848f 100755
--- a/lib/App/Dthumb.pm
+++ b/lib/App/Dthumb.pm
@@ -44,6 +44,7 @@ sub new {
sub run {
my ($self) = @_;
+ $self->check_cmd_flags();
$self->read_directories();
$self->create_files();
$self->delete_old_thumbnails();
@@ -51,6 +52,19 @@ sub run {
$self->write_out_html();
}
+sub check_cmd_flags {
+ my ($self) = @_;
+
+ if ($self->{config}->{version}) {
+ say "dthumb version ${VERSION}";
+ exit 0;
+ }
+ if ($self->{config}->{help}) {
+ say "Please refer to perldoc -F $0 (or man dthumb)";
+ exit 0;
+ }
+}
+
sub read_directories {
my ($self) = @_;
my $thumbdir = $self->{config}->{dir_thumbs};