git submodule: Cleanup usage string and add option parsing to cmd_foreach()
Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
1e7f2aad7d
commit
1d5bec8b9c
@ -4,9 +4,14 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2007 Lars Hjemli
|
# Copyright (c) 2007 Lars Hjemli
|
||||||
|
|
||||||
USAGE="[--quiet] [--cached] \
|
dashless=$(basename "$0" | sed -e 's/-/ /')
|
||||||
[add [-b branch] <repo> <path>]|[status|init|update [-i|--init] [-N|--no-fetch] [--rebase|--merge]|summary [-n|--summary-limit <n>] [<commit>]] \
|
USAGE="[--quiet] add [-b branch] [--reference <repository>] [--] <repository> <path>
|
||||||
[--] [<path>...]|[foreach <command>]|[sync [--] [<path>...]]"
|
or: $dashless [--quiet] status [--cached] [--] [<path>...]
|
||||||
|
or: $dashless [--quiet] init [--] [<path>...]
|
||||||
|
or: $dashless [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--reference <repository>] [--merge] [--] [<path>...]
|
||||||
|
or: $dashless [--quiet] summary [--cached] [--summary-limit <n>] [commit] [--] [<path>...]
|
||||||
|
or: $dashless [--quiet] foreach <command>
|
||||||
|
or: $dashless [--quiet] sync [--] [<path>...]"
|
||||||
OPTIONS_SPEC=
|
OPTIONS_SPEC=
|
||||||
. git-sh-setup
|
. git-sh-setup
|
||||||
. git-parse-remote
|
. git-parse-remote
|
||||||
@ -237,6 +242,23 @@ cmd_add()
|
|||||||
#
|
#
|
||||||
cmd_foreach()
|
cmd_foreach()
|
||||||
{
|
{
|
||||||
|
# parse $args after "submodule ... foreach".
|
||||||
|
while test $# -ne 0
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
-q|--quiet)
|
||||||
|
GIT_QUIET=1
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
module_list |
|
module_list |
|
||||||
while read mode sha1 stage path
|
while read mode sha1 stage path
|
||||||
do
|
do
|
||||||
|
Reference in New Issue
Block a user