Skip to content

parse-options: long option parsing fixes and cleanup

René Scharfe git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 7 repliesIn review
  2. v16 patches 2 repliesSuperseded

Changes in v2 from the cover letter

* Added sign-off.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6parse-options: recognize abbreviated negated option with argparse-options.c t/t0040-parse-options.sh+19 -21 reply
2/6parse-options: set arg of abbreviated option lazilyparse-options.c+4 -30 replies
3/6parse-options: factor out register_abbrev() and struct parsed_optionparse-options.c+49 -343 replies
4/6parse-options: detect ambiguous self-negationparse-options.c t/t1502-rev-parse-parseopt.sh+12 -20 replies
5/6parse-options: normalize arg and long_name before comparisonparse-options.c+22 -221 reply
6/6parse-options: rearrange long_name matching codeparse-options.c+15 -221 reply

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJosh Steadmon
SeriesR-b
1/6
2/6
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/6] parse-options: long option parsing fixes and cleanup

Fix two corner cases in patches 1 and 4, refactor the code in patches 2 and 3 to prepare the second fix, bonus patches 5 and 6 simplify the code and improve readability.

Changes since v1:
* Added sign-off.

parse-options: recognize abbreviated negated option with arg
parse-options: set arg of abbreviated option lazily
parse-options: factor out register_abbrev() and struct parsed_option
parse-options: detect ambiguous self-negation
parse-options: normalize arg and long_name before comparison
parse-options: rearrange long_name matching code

 parse-options.c               | 137 ++++++++++++++++++----------------
 t/t0040-parse-options.sh      |  16 ++++
 t/t1502-rev-parse-parseopt.sh |  11 +++
 3 files changed, 100 insertions(+), 64 deletions(-)

--
2.44.0