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>
This commit is contained in:
committed by
Junio C Hamano
parent
363d59df1a
commit
a0ec9d25d9
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user