Skip to content

Commit

Permalink
close #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Pennebaker committed Sep 17, 2024
1 parent 8ccf87d commit 0da72ae
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions bin/harmonica
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ set -euf
HARMONICA_VERSION='0.0.1'
PREFIX='issue-'
BATCH_CAPACITY='0'
POST_PROCESS_CBZ='0'
LF='
'

usage() {
echo "Usage: $0 [OPTIONS] <source directory>"
echo ''
echo "-p\t<destination directory prefix>\tDefault: \"$PREFIX\""
echo "-n\t<batch directory capacity>\tDefault: (source directory entries)/2"
echo "-v\t\t\t\t\tShow version"
echo "-h\t\t\t\t\tShow usage menu"
echo "-p <prefix>\tcustomize target prefix (default: \"$PREFIX\")"
echo "-n <limit>\tapply uniform directory size (default: source entries / 2)"
echo "-z\t\tpost-process cbz archival (default: false)"
echo "-v\t\tshow version"
echo "-h\t\tshow usage menu"
}

ARGS="$*"
Expand Down Expand Up @@ -43,6 +45,10 @@ for ARG in $ARGS; do
BATCH_CAPACITY="$1"
shift
;;
-z)
POST_PROCESS_CBZ='1'
shift
;;
-v)
echo "$HARMONICA_VERSION"
exit
Expand Down Expand Up @@ -90,5 +96,9 @@ find_source |
cp "$f" "$TARGET"
done

if [ "$POST_PROCESS_CBZ" -eq '1' ]; then
zip -r "${TARGET}.cbz" "$TARGET"
fi

I=$((I + 1))
done

0 comments on commit 0da72ae

Please sign in to comment.