mirror of
https://github.com/kennethreitz-archive/git-export.git
synced 2026-06-05 23:50:19 +00:00
Use git-export use getopt to parse arguments
This commit is contained in:
+14
-6
@@ -13,20 +13,28 @@ OPTIONS_SPEC=
|
||||
force=0
|
||||
destination=
|
||||
|
||||
while :
|
||||
do
|
||||
case $1 in
|
||||
args=`getopt -o fh -l force,help,he,hel -- "$@"`
|
||||
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
|
||||
|
||||
eval set -- "$args"
|
||||
|
||||
while true ; do
|
||||
case "$1" in
|
||||
-f|--force)
|
||||
force=1
|
||||
shift
|
||||
;;
|
||||
-h|--h|--he|--hel|--help)
|
||||
usage
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift; break ;;
|
||||
*)
|
||||
break
|
||||
echo "Invalid argument found!" >&2
|
||||
exit 2;
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
|
||||
Reference in New Issue
Block a user