summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/dthumb3
-rwxr-xr-xlib/App/Dthumb.pm14
2 files changed, 16 insertions, 1 deletions
diff --git a/bin/dthumb b/bin/dthumb
index 38e330e..8c96670 100755
--- a/bin/dthumb
+++ b/bin/dthumb
@@ -13,11 +13,12 @@ my $opt = {};
GetOptions(
$opt,
qw{
+ help|h
size|d=i
spacing|s=f
no-names|n
quality|q=i
- archive|x
+ version|v
},
) or die("Please see perldoc -F $0\n");
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};