commit 9b67633f54f4de54df4db32a919c0efd5b5f0e0b
parent e7a8cb6681b3ef97334c47fabdc61ef7f6761e7b
Author: René Wagner <rwa@clttr.info>
Date: Mon, 1 May 2023 19:32:49 +0200
add man page for afm
Diffstat:
5 files changed, 65 insertions(+), 12 deletions(-)
diff --git a/Makefile b/Makefile
@@ -6,20 +6,25 @@ DOCDIR?=$(PREFIX)/share/doc
COMPLDIR?=$(PREFIX)/share/bash-completion
.DEFAULT_GOAL=all
+afm.1: afm.1.scd
+ scdoc < $< > $@
+
afm:
jd:
-all: afm jd
+all: afm afm.1 jd
install: all
- mkdir -p $(DESTDIR)/$(BINDIR)
+ mkdir -p $(DESTDIR)/$(BINDIR) $(DESTDIR)/$(MANDIR)/man1
install -m755 afm $(DESTDIR)/$(BINDIR)/afm
install -m755 jd $(DESTDIR)/$(BINDIR)/jd
+ install -m644 afm.1 $(DESTDIR)/$(MANDIR)/man1/afm.1
uninstall:
rm -f $(DESTDIR)/$(BINDIR)/afm
rm -f $(DESTDIR)/$(BINDIR)/jd
+ rm -f $(DESTDIR)/$(MANDIR)/man1/afm.1
-check: all
- @find test -perm -111 -exec '{}' \;
+clean:
+ rm -rf afm.1
diff --git a/PKGBUILD b/PKGBUILD
@@ -7,6 +7,7 @@ pkgdesc='simple helper scripts for managing images processed by ART'
arch=('x86_64' 'aarch64' 'i686')
license=('BSD')
depends=('perl-file-find-rule')
+makedepends=('scdoc')
url='https://git.sr.ht/~rwa/art-helpers'
provides=('art-helpers')
options=(!strip)
diff --git a/README.md b/README.md
@@ -1,8 +1,10 @@
# About
This rather small scripts written in [Perl](https://perl.org) provide useful function for managing (raw and output) files for photographers.
-## usage
-Simply clone the repo or manually download the scripts from https://git.sr.ht/~rwa/art-helpers
+## usage
+* clone the repo or manually download the scripts from https://git.sr.ht/~rwa/art-helpers
+* run `make`
+* run `sudo make install`
To run the script, open a shell and invoke `perl <script>`, on most systems it should be sufficient to just invoke `script` (after you granted execute-permissions to the script).
@@ -23,7 +25,7 @@ Additionally the following perl modules need to be installed:
# ART helper scripts
Helper scripts to manage files which where handled by [ART](https://clttr.info/art), the easy-to-use RAW converter forked from RawTherapee.
-ilkypix usually uses a folder structure similar to this example:
+My working directory uses a folder structure similar to this example:
```
base folder
@@ -41,8 +43,11 @@ Filename: `afm`
Find all by ART converted files in the current folder and their corresponding RAWs and move them to specified directory.
+For more information run `man afm` or `afm --help`.
+
## JpegDivider
Filename: `jd`
Moves all jpeg files (suffixes .jpg and .jpeg) in the given folder or the current working directory to the subfolder JPEG (or the given subfolder).
+For more information run `jd --help`.
diff --git a/afm b/afm
@@ -9,12 +9,13 @@ use File::Basename;
use File::Copy;
use File::Find::Rule;
use File::Spec::Functions;
+use File::Path qw(make_path);
use File::HomeDir;
use Getopt::Std;
$Getopt::Std::STANDARD_HELP_VERSION = 'true';
-my $VERSION = '1.0';
+my $VERSION = '1.1';
my $PROGRAM = 'ART File Mover';
my $configfile = catfile(File::HomeDir->my_home, '.afm.conf');
@@ -31,15 +32,15 @@ getconfig();
getopts('lR:F:E:C:f:') or die "Invalid parameters provided! See 'afm --help' for more details.";
-# read remaining commandline args für destination dir
+# read remaining commandline args for destination dir
# last dir will win
-# fallback to list-only mode when no dir is given
my $destination_dir = getcwd;
foreach my $arg ( @ARGV )
{
$destination_dir = $arg;
}
+# fallback to list-only mode when no dir is given
if ($destination_dir eq getcwd) { $opt_l = 1; }
writeconfig();
@@ -65,8 +66,8 @@ sub move_files
if ( !$opt_l && (! -d $destination_dir || ! -d $converted_destination_dir))
{
- if (! -d $destination_dir ) { mkdir $destination_dir or die "Could not create destination dir $_ : $!"; }
- if (! -d $converted_destination_dir ) { mkdir $converted_destination_dir or die "Could not create destination dir $_ : $!"; }
+ if (! -d $destination_dir ) { make_path $destination_dir or die "Could not create destination dir $_ : $!"; }
+ if (! -d $converted_destination_dir ) { make_path $converted_destination_dir or die "Could not create destination dir $_ : $!"; }
}
# find all jpegs in current dir
diff --git a/afm.1.scd b/afm.1.scd
@@ -0,0 +1,41 @@
+afm(1) "afm" "afm Documenation"
+
+# NAME
+afm - photo statistic processor for your terminal
+
+# SYNOPSIS
+*afm* [*-D* _<file>_] [*-l*] ...
+
+*afm* moves all images that have been processed by ART and related side-car files to a given destination folder.
+
+# USAGE
+
+You could use as many different databases as you'd like to, whatever suits your needs (maybe split private and commercial data). Use the *-D* param to specify on which database file you want to operate.
+
+# OPTIONS
+Options in CAPITAL LETTERS (like *-E*) will automatically be persisted in the user's config file located at _~/.afm.conf_.
+
+ *-C* <folder>
+ Copy the converted (output) files (ie jpegs) to an additional directory
+
+ *-E* <ext>
+ Override the converted file extenion (case-insensitive), defaults to "jp(e)g"++
+ Perl-compatible regular expressions allowed
+
+ *-f* <exp>
+ Filter files by regex - only raw files that match the PCRE are processed++
+ needs to be quoted
+
+ *-F* <folder>
+ Override the folder for converted files, defaults to "JPEG"
+
+ *-l*
+ Run in list-only mode - does not move files but only lists which files would be moved
+
+ *-R* <raw>
+ Override the raw extensions, defaults to "DNG"
+
+# AUTHOR
+
+Maintained by René Wagner <rwa@clttr.info>.++
+Project repo can be found at https://git.sr.ht/~rwa/art-helpers