summaryrefslogtreecommitdiff
path: root/parse-options.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-02-29 01:45:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-03-01 09:51:44 (GMT)
commita0ec9d25d9f1c1469ec375169557a1c17d486993 (patch)
treeb9cebfe937f766970f72895414dc59e20e82a796 /parse-options.c
parent363d59df1a773039d0c69ad8c3109a56bb1b491d (diff)
downloadgit-a0ec9d25d9f1c1469ec375169557a1c17d486993.zip
git-a0ec9d25d9f1c1469ec375169557a1c17d486993.tar.gz
git-a0ec9d25d9f1c1469ec375169557a1c17d486993.tar.bz2
parseopt: add flag to stop on first non option
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.c')
-rw-r--r--parse-options.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/parse-options.c b/parse-options.c
index d9562ba..be35785 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -249,6 +249,8 @@ int parse_options(int argc, const char **argv, const struct option *options,
const char *arg = args.argv[0];
if (*arg != '-' || !arg[1]) {
+ if (flags & PARSE_OPT_STOP_AT_NON_OPTION)
+ break;
argv[j++] = args.argv[0];
continue;
}