@matheusbsbs / matheus-bagliano / commits / 98a4fef3f2
Fork 0

Make git-clone to take long double-dashed origin option (--origin)

git-clone currently take option '-o' to specify origin. this patch makes git-clone to take double-dashed option '--origin' and other abbreviations in addtion to the current single-dashed option. [jc: with minor fixups] Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Yasushi SHOJI committed Mar 30, 2006 at 17:00 UTC 98a4fef3f28e48d12a4fecd5cf97daa774c1e5bc
1 file changed +6 -5
git-clone.sh
+6 -5
@@ -9,7 +9,7 @@
9 unset CDPATH
10
11 usage() {
12 - echo >&2 "Usage: $0 [--use-separate-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [-o <name>] [-n] <repo> [<dir>]"
12 + echo >&2 "Usage: $0 [--use-separate-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [-n] <repo> [<dir>]"
13 exit 1
14 }
15
@@ -121,14 +121,15 @@ while
121 *,-q|*,--quiet) quiet=-q ;;
122 *,--use-separate-remote)
123 use_separate_remote=t ;;
124 - 1,-o) usage;;
124 1,--reference) usage ;;
125 *,--reference)
126 shift; reference="$1" ;;
127 *,--reference=*)
128 reference=`expr "$1" : '--reference=\(.*\)'` ;;
130 - *,-o)
129 + *,-o|*,--or|*,--ori|*,--orig|*,--origi|*,--origin)
130 case "$2" in
131 + '')
132 + usage ;;
133 */*)
134 echo >&2 "'$2' is not suitable for an origin name"
135 exit 1
@@ -138,7 +139,7 @@ while
139 exit 1
140 }
141 test -z "$origin_override" || {
141 - echo >&2 "Do not give more than one -o options."
142 + echo >&2 "Do not give more than one --origin options."
143 exit 1
144 }
145 origin_override=yes
@@ -160,7 +161,7 @@ if test yes = "$bare"
161 then
162 if test yes = "$origin_override"
163 then
163 - echo >&2 '--bare and -o $origin options are incompatible.'
164 + echo >&2 '--bare and --origin $origin options are incompatible.'
165 exit 1
166 fi
167 if test t = "$use_separate_remote"