]> git.ipfire.org Git - thirdparty/git.git/commit
parseopt: check for duplicate long names and numerical options
authorRené Scharfe <l.s.r@web.de>
Sat, 28 Feb 2026 09:19:16 +0000 (10:19 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Mar 2026 15:39:01 +0000 (07:39 -0800)
commit237e520d81201eee609cf21e24f1c7ac6719ec8a
tree049859b247223f25291cf20217aedd91554fae57
parenta5f2ff6ce87b1a07953461536f2b0c22631c94ba
parseopt: check for duplicate long names and numerical options

We already check for duplicate short names.  Check for and report
duplicate long names and numerical options as well.

Perform the slightly expensive string duplicate check only when showing
the usage to keep the cost of normal invocations low.  t0012-help.sh
covers it.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.c