summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xanondcim30
1 files changed, 11 insertions, 19 deletions
diff --git a/anondcim b/anondcim
index def65b1..38009b5 100755
--- a/anondcim
+++ b/anondcim
@@ -32,23 +32,17 @@ file_prefix=""
dst_size="1280"
dst_dir=""
-while getopts ':p:s:d:' OPTION
-do
+while getopts ':p:s:d:' OPTION; do
case $OPTION in
- "p")
- file_prefix="${OPTARG}"
- ;;
- "s")
- dst_size="$OPTARG"
- ;;
- "d")
- # enforce a trailing "/"
- [ -d "${OPTARG%/}/" ] && dst_dir="${OPTARG%/}/" || die "destination directory \"${OPTARG%/}/\" does not exist"
- ;;
- *)
- err "not recognised: OPTION=$OPTION, OPTARG=$OPTARG"
- die_usage
- ;;
+ "p") file_prefix="${OPTARG}";;
+ "s") dst_size="$OPTARG";;
+ "d") # enforce a trailing "/"
+ [ -d "${OPTARG%/}/" ] && dst_dir="${OPTARG%/}/" \
+ || die "destination directory \"${OPTARG%/}/\" does not exist"
+ ;;
+ *) err "not recognised: OPTION=$OPTION, OPTARG=$OPTARG"
+ die_usage
+ ;;
esac
done
shift $(($OPTIND - 1))
@@ -56,8 +50,7 @@ shift $(($OPTIND - 1))
cur=1
total=$#
-for fn in "$@"
-do
+for fn in "$@"; do
if [ -z "$dst_dir" ]; then
# use the directory of the source file
dst="$(dirname "$fn")/"
@@ -105,4 +98,3 @@ EOF
cur=$(($cur + 1))
done
-
contact: Jan Huwald // Impressum