Re: [PATCH 1/4] i18n: factorize more 'incompatible options' messages
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Jan 25, 2022, 21:26 UTC
- Message-ID
- <5740b0c5-7df8-5947-a4c9-0ece2bf17891@kdbg.org>
- In-Reply-To
- <2894278.sRLLl5rxgE@cayenne>
Am 25.01.22 um 21:52 schrieb Jean-Noël AVILA:
Show 20 quoted lines
> Le lundi 24 janvier 2022, 12:06:19 CET Phillip Wood a écrit : >> On 24/01/2022 07:14, Johannes Sixt wrote: >>> A general comment: To me, it looks like you didn't want to change the >>> variable name 'f' in the first hunk above, and then just named the array >>> 'f_options' to go with 'f'. Perhaps `exclusive_opt` (not plural!) for >>> the array. Now, renaming 'f' to something longer makes the code a bit >>> unwieldy. Therefore, let me suggest yet another approach: factor out >>> functions check_exclusive_opts3(), check_exclusive_opts4(), to be used > like >>> >>> check_exclusive_opts3(use_stdout, "--stdout", >>> rev.diffopt.close_file, "--output", >>> output_directory, "--output-directory"); >>> >>> I am not yet proposing check_exclusive_opts2(), but others may think it >>> is an improvement, too, (if they think that such functions are an >>> improvement in the first place). > > Will factorize away such exclusive options, but I'm not sure where. Should it > be in git-compat-util.h?
How about parse-options.*? There are already some helper functions near the end of parse-options.c. Perhaps the names I suggested must be revised, though.
-- Hannes