chiark / gitweb /
tg import: Standard options parsing
[topgit.git] / tg-import.sh
index ddd532110ab37a75a3bac7d39b10c69728601e08..910d30080abb498c89d216280104622a6c07700d 100644 (file)
@@ -4,6 +4,22 @@
 # (c) Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>  2008
 # GPLv2
 
+ranges=
+
+
+## Parse options
+
+while [ -n "$1" ]; do
+       arg="$1"; shift
+       case "$arg" in
+       -*)
+               echo "Usage: tg [...] import RANGE..." >&2
+               exit 1;;
+       *)
+               ranges="$ranges $arg";;
+       esac
+done
+
 
 tg_get_commit_msg()
 {
@@ -40,7 +56,7 @@ tg_process_commit()
 }
 
 # nice arg verification stolen from git-format-patch.sh
-for revpair
+for revpair in $ranges
 do
        case "$revpair" in
        ?*..?*)