Code

bash: refactor searching for subcommands on the command line
authorSZEDER Gábor <szeder@ira.uka.de>
Mon, 10 Mar 2008 15:02:23 +0000 (16:02 +0100)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 10 Mar 2008 23:45:20 +0000 (19:45 -0400)
commit3ff1320d4be164e35a685d8d00b6f44084be76e0
tree6fb2f1818eb76eab3b5180bfa0ab0fb5a8498c32
parent1d17b22ebf9d894cef393e3e062f383aad8817e8
bash: refactor searching for subcommands on the command line

This patch adds the __git_find_subcommand function, which takes one
argument: a string containing all subcommands separated by spaces.  The
function searches through the command line whether a subcommand is
already present.  The first found subcommand will be printed to standard
output.

This enables us to remove code duplications from completion functions
for commands having subcommands.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
contrib/completion/git-completion.bash