Skip to content

Commit b71687c

Browse files
Roy Eldargitster
authored andcommitted
git-submodule.sh: improve parsing of some long options
Some command-line options have a long form which takes an argument. In this case, the argument can be given right after `='; for example, "--depth" takes a numerical argument, which can be given as "--depth=X". Support the case where the argument is given right after `=' for all long options, in order to improve consistency throughout the script. Signed-off-by: Roy Eldar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 92999a4 commit b71687c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

git-submodule.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ cmd_add()
7777
branch=$2
7878
shift
7979
;;
80+
--branch=*)
81+
branch="${1#--branch=}"
82+
;;
8083
-f | --force)
8184
force=$1
8285
;;
@@ -110,6 +113,9 @@ cmd_add()
110113
custom_name=$2
111114
shift
112115
;;
116+
--name=*)
117+
custom_name="${1#--name=}"
118+
;;
113119
--depth)
114120
case "$2" in '') usage ;; esac
115121
depth="--depth=$2"
@@ -425,6 +431,9 @@ cmd_set_branch() {
425431
branch=$2
426432
shift
427433
;;
434+
--branch=*)
435+
branch="${1#--branch=}"
436+
;;
428437
--)
429438
shift
430439
break

0 commit comments

Comments
 (0)