git-submodule: fix subcommand parser
commit5c08dbbdf1a2d2565606bb43f7e42a5968fcbdf1
authorJunio C Hamano <gitster@pobox.com>
Tue, 15 Jan 2008 10:48:45 +0000 (15 02:48 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Jan 2008 04:57:42 +0000 (20 20:57 -0800)
treedb9739be96336cd499850fbf71dcd750a405f939
parent23a485e3ee32a9445e1c20bd4fd4b93119cd4f7c
git-submodule: fix subcommand parser

The subcommand parser of "git submodule" made its subcommand
names reserved words.  As a consequence, a command like this:

    $ git submodule add init update

which is meant to add a submodule called 'init' at path 'update'
was misinterpreted as a request to invoke more than one mutually
incompatible subcommands and incorrectly rejected.

This patch fixes the issue by stopping the subcommand parsing at
the first subcommand word, to allow the sample command line
above to work as expected.

It also introduces the usual -- option disambiguator, so that a
submodule at path '-foo' can be updated with

    $ git submodule update -- -foo

without triggering an "unrecognized option -foo" error.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh