Re: [PATCH] argmatch: add variants that only match full argument

2022-01-30 Thread Pádraig Brady
On 30/01/2022 18:58, Bruno Haible wrote: Pádraig Brady wrote: * lib/argmatch.h (argmatch_exact, [X]ARGMATCH_EXACT): New interfaces that don't support abbreviations. * lib/argmatch.c (argmatch_exact, __xargmatch_exact_internal): Likewise. * tests/test-argmatch.c: Add tests. The code looks corre

Re: [PATCH] argmatch: add variants that only match full argument

2022-01-30 Thread Bruno Haible
Pádraig Brady wrote: > * lib/argmatch.h (argmatch_exact, [X]ARGMATCH_EXACT): New interfaces > that don't support abbreviations. > * lib/argmatch.c (argmatch_exact, __xargmatch_exact_internal): Likewise. > * tests/test-argmatch.c: Add tests. The code looks correct. But I see some code duplication:

argmatch: add variants that only match full argument

2022-01-30 Thread Pádraig Brady
I would like a more constrained argument matching to improve forward compatibility and robustness. For example I would like `cksum -a sha3` to _not_ be equivalent to `cksum -a sha386`, so that a user specifying `-a sha3` on an older cksum would not be surprised. Also argmatch() is used when parsin

[PATCH] argmatch: add variants that only match full argument

2022-01-30 Thread Pádraig Brady
draig Brady + + argmatch: add variants that only match full argument + * lib/argmatch.h (argmatch_exact, [X]ARGMATCH_EXACT): New interfaces + that don't support abbreviations. + * lib/argmatch.c (argmatch_exact, __xargmatch_exact_internal): Likewise. + * tests/test-