mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 09:50:09 +00:00
reworked how args are handled...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8b643b0b36
commit
6abcecb10b
@ -4,17 +4,50 @@
|
||||
# XXX add help...
|
||||
# XXX add better options...
|
||||
|
||||
|
||||
FPS=${FPS:-8}
|
||||
if [ "$1" == "-r" ] ; then
|
||||
FPS="$2"
|
||||
shift 2
|
||||
fi
|
||||
if ! [ -z "$1" ] ; then
|
||||
PATTERN="$1"
|
||||
else
|
||||
PATTERN=${PATTERN:-'*.jpg'}
|
||||
fi
|
||||
PATTERN=${PATTERN:-'*.@(jpg|jpeg|png)'}
|
||||
|
||||
while true ; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
echo "Usage: $(basename $0) [OPTIONS] [PATTERN]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -h --help - print this message and exit"
|
||||
echo " -r --rate FPS - set framerate (default: $FPS)"
|
||||
echo " -p --pattern PATTERN"
|
||||
echo " - image pattern to use (default: '$PATTERN')"
|
||||
echo
|
||||
echo "NOTE: option defaults can bbe overriden by coresponding env variables."
|
||||
echo
|
||||
exit
|
||||
;;
|
||||
-r|--rate)
|
||||
FPS="$2"
|
||||
shift 2
|
||||
continue
|
||||
;;
|
||||
-p|--pattern)
|
||||
PATTERN="%2"
|
||||
shift 2
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
PATTERN="%1"
|
||||
shift
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
##if [ "$1" == "-r" ] ; then
|
||||
## FPS="$2"
|
||||
## shift 2
|
||||
##fi
|
||||
##if ! [ -z "$1" ] ; then
|
||||
## PATTERN="$1"
|
||||
##fi
|
||||
|
||||
LST=($PATTERN)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user