art-helpers

simple helper scripts for managing images processed by ART
git clone https://git.clttr.info/art-helpers.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 241bc3e756e131cd09a664867fc128eb84abd098
parent aacc80ef55df19a1a2a64d380a82f58c90d257b0
Author: René Wagner <rwagner@rw-net.de>
Date:   Wed, 11 Mar 2020 21:29:50 +0100

use opt-variables directly

Diffstat:
Mjpegdivider.pl | 12++++++------
Msilkypix_multiversion_sidecar_cleaner.pl | 10+++++-----
Msilkypix_orphaned_sidecar_cleaner.pl | 10+++++-----
3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/jpegdivider.pl b/jpegdivider.pl @@ -36,22 +36,22 @@ foreach my $arg ( @ARGV ) if ( -d $arg ) { $work_dir = $arg } } -move_files($work_dir, $opt_m); +move_files($work_dir); exit 0; sub move_files { - my ( $dir, $move_flag ) = @_; + my ( $dir ) = @_; my $move_counter = 0; say "working directory: $dir"; - say 'action : '. ($move_flag ? 'move' : 'list only'); + say 'action : '. ($opt_m ? 'move' : 'list only'); say "subfolder : $opt_f"; say ''; my $destination_dir = catdir($dir, $opt_f); - if ( $move_flag && ! -d $destination_dir ) + if ( $opt_m && ! -d $destination_dir ) { mkdir $destination_dir or die "Could not create destination dir $_ : $!"; } @@ -62,7 +62,7 @@ sub move_files { print $file .'...'; $move_counter++; - if ( $move_flag ) + if ( $opt_m ) { if ( move($file, catfile($destination_dir, basename($file)) ) ) { @@ -84,7 +84,7 @@ sub main::VERSION_MESSAGE() say $PROGRAM . ' - version ' . $VERSION; say 'published under BSD 3 - Clause License'; say 'Copyright(c) 2019-2020 René Wagner'; - say 'https://www.codewolke.net/photo-helpers/'; + say 'https://git.clttr.info/photo-helpers/'; } sub main::HELP_MESSAGE diff --git a/silkypix_multiversion_sidecar_cleaner.pl b/silkypix_multiversion_sidecar_cleaner.pl @@ -33,17 +33,17 @@ foreach my $arg ( @ARGV ) if ( -d $arg ) { $work_dir = $arg } } -delete_files($work_dir, $opt_d); +delete_files($work_dir); exit 0; sub delete_files { - my ( $dir, $delete_flag ) = @_; + my ( $dir ) = @_; my ( $file_counter ) = 0; say "working directory: $dir"; - say 'action : '. ($delete_flag ? 'delete' : 'list only') . "\r\n"; + say 'action : '. ($opt_d ? 'delete' : 'list only') . "\r\n"; say 'files with newer versions:'; # alle Dateien in allen Unterordnern *.spd *.spf suchen @@ -56,7 +56,7 @@ sub delete_files { print $file .'...'; $file_counter++; - if ( $delete_flag ) + if ( $opt_d ) { if ( unlink $file ) { @@ -107,7 +107,7 @@ sub main::VERSION_MESSAGE() say $PROGRAM . ' - version ' . $VERSION; say 'published under BSD 3 - Clause License'; say 'Copyright(c) 2019-2020 René Wagner'; - say 'https://www.codewolke.net/photo-helpers/'; + say 'https://git.clttr.info/photo-helpers/'; } sub main::HELP_MESSAGE diff --git a/silkypix_orphaned_sidecar_cleaner.pl b/silkypix_orphaned_sidecar_cleaner.pl @@ -34,17 +34,17 @@ foreach my $arg ( @ARGV ) if ( -d $arg ) { $work_dir = $arg } } -delete_files($work_dir, $opt_d); +delete_files($work_dir); exit 0; sub delete_files { - my ( $delete_dir, $delete_flag ) = @_; + my ( $delete_dir ) = @_; my ( $file_counter ) = 0; say "working directory: $delete_dir"; - say 'action : '. ($delete_flag ? 'delete' : 'list only') ."\r\n"; + say 'action : '. ($opt_d ? 'delete' : 'list only') ."\r\n"; say 'files with missing raw:'; # alle Dateien in allen Unterordnern *.spd *.spf suchen @@ -56,7 +56,7 @@ sub delete_files { print $file .'...'; $file_counter++; - if ( $delete_flag ) + if ( $opt_d ) { if ( unlink $file ) { @@ -93,7 +93,7 @@ sub main::VERSION_MESSAGE() say $PROGRAM . ' - version ' . $VERSION; say 'published under BSD 3 - Clause License'; say 'Copyright(c) 2019-2020 René Wagner'; - say 'https://www.codewolke.net/photo-helpers/'; + say 'https://git.clttr.info/photo-helpers/'; } sub main::HELP_MESSAGE