Update ft
This commit is contained in:
30
bin/ft
30
bin/ft
@@ -3,4 +3,32 @@ set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
exec f2 -f "(\w+)[_-](\d\d\d\d)[-]?(\d\d)[-]?(\d\d)[_-](.*)" -r '$2-$3-$4 $5' "$@"
|
||||
use_exif=false
|
||||
args=()
|
||||
|
||||
while (($#)); do
|
||||
case "$1" in
|
||||
-e)
|
||||
use_exif=true
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
args+=("$@")
|
||||
break
|
||||
;;
|
||||
*)
|
||||
args+=("$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if $use_exif; then
|
||||
f2 \
|
||||
-f '{strlen("{x.cdt}") > 0}' \
|
||||
-r '{x.cdt.YYYY}-{x.cdt.MM}-{x.cdt.DD} {x.cdt.H}-{x.cdt.mm}-{x.cdt.ss} {f}{ext}' \
|
||||
"${args[@]}"
|
||||
else
|
||||
exec f2 -f "(\w+)[_-](\d\d\d\d)[-]?(\d\d)[-]?(\d\d)[_-](.*)" -r '$2-$3-$4 $5' "${args[@]}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user