summaryrefslogtreecommitdiff
path: root/check-racy.c
diff options
context:
space:
mode:
authorLibravatar Jonathan Nieder <jrnieder@gmail.com>2010-12-02 00:01:18 -0600
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-12-07 14:15:12 -0800
commit1e5ce570ca368b97c8e3b238bb0228c5ca41b494 (patch)
tree8b56df17fd7985bd93d2ff1d5c55b5b7a577962a /check-racy.c
parentparse-options: Don't call parse_options_check() so much (diff)
downloadtgif-1e5ce570ca368b97c8e3b238bb0228c5ca41b494.tar.xz
parse-options: clearer reporting of API misuse
The PARSE_OPT_LASTARG_DEFAULT flag is meant for options like --contains that (1) traditionally had a mandatory argument and (2) have some better behavior to use when appearing in the final position. It makes no sense to combine this with OPTARG, so ever since v1.6.4-rc0~71 (parse-options: add parse_options_check to validate option specs, 2009-07-09) this mistake is flagged with error: `--option` uses incompatible flags LASTARG_DEFAULT and OPTARG and an exit status representing an error in commandline usage. Unfortunately that which might confuse scripters calling such an erroneous program into thinking the _script_ contains an error. Clarify that it is an internal error by dying with a message beginning "error: BUG: ..." and status 128. While at it, clean up parse_options_check to prepare for more checks. Long term, it would be nicer to make such checks happen at compile time. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'check-racy.c')
0 files changed, 0 insertions, 0 deletions