#!/bin/bash
+# copyright 2012,2013 Arun Persaud <arun@nubati.net>
+#
+# This file is part of photo-tags.
+#
+# Photo-tags is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Photo-tags is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Photo-tags. If not, see <http://www.gnu.org/licenses/>.
+
NICE="nice -19"
# init some variables
limit=`$NICE sqlite3 $LOCALDB "select count(*) from photos"`
+function usage()
+{
+ echo "Usage: $0 [OPTIONS]"
+ echo " Options:"
+ echo " -r remove metadata from pictures"
+ echo " -l NUMBER only process NUMBER pictures"
+}
+
# parse command line
-while getopts ":rl:" opt; do
+while getopts ":rl:h" opt; do
case $opt in
r)
removemeta=1
l)
limit=$OPTARG
;;
+ h)
+ usage
+ exit 0
+ ;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1