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 <royeldar0@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
92999a42db
commit
b71687ca03
@@ -77,6 +77,9 @@ cmd_add()
|
|||||||
branch=$2
|
branch=$2
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--branch=*)
|
||||||
|
branch="${1#--branch=}"
|
||||||
|
;;
|
||||||
-f | --force)
|
-f | --force)
|
||||||
force=$1
|
force=$1
|
||||||
;;
|
;;
|
||||||
@@ -110,6 +113,9 @@ cmd_add()
|
|||||||
custom_name=$2
|
custom_name=$2
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--name=*)
|
||||||
|
custom_name="${1#--name=}"
|
||||||
|
;;
|
||||||
--depth)
|
--depth)
|
||||||
case "$2" in '') usage ;; esac
|
case "$2" in '') usage ;; esac
|
||||||
depth="--depth=$2"
|
depth="--depth=$2"
|
||||||
@@ -425,6 +431,9 @@ cmd_set_branch() {
|
|||||||
branch=$2
|
branch=$2
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--branch=*)
|
||||||
|
branch="${1#--branch=}"
|
||||||
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user