Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-merge: refactor option parsing
author
Lars Hjemli
<hjemli@gmail.com>
Sun, 23 Sep 2007 22:51:42 +0000
(
00:51
+0200)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 24 Sep 2007 00:14:03 +0000
(17:14 -0700)
Move the option parsing into a separate function as preparation for reuse
by the next commit.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-merge.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
2ae4fd7
)
diff --git
a/git-merge.sh
b/git-merge.sh
index 919e6be4b016dd9835a85ebabd1c5f7d86053ae6..49185eb5d2199a39d3f7a02ef1c1cc054634cf94 100755
(executable)
--- a/
git-merge.sh
+++ b/
git-merge.sh
@@
-119,11
+119,7
@@
merge_name () {
fi
}
fi
}
-case "$#" in 0) usage ;; esac
-
-have_message=
-while test $# != 0
-do
+parse_option () {
case "$1" in
-n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
--no-summa|--no-summar|--no-summary)
case "$1" in
-n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
--no-summa|--no-summar|--no-summary)
@@
-166,9
+162,21
@@
do
have_message=t
;;
-*) usage ;;
have_message=t
;;
-*) usage ;;
- *)
break
;;
+ *)
return 1
;;
esac
shift
esac
shift
+ args_left=$#
+}
+
+test $# != 0 || usage
+
+have_message=
+while parse_option "$@"
+do
+ while test $args_left -lt $#
+ do
+ shift
+ done
done
if test -z "$show_diffstat"; then
done
if test -z "$show_diffstat"; then