Re: [PATCH 10/10] parse-options: change OPT_{SHORT,UNSET} to an enum
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 29, 2021, 00:50 UTC
- Message-ID
- <xmqqwnn0fbm5.fsf@gitster.g>
- In-Reply-To
- <patch-10.10-a28ab961125-20210928T130905Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> Change the comparisons against OPT_SHORT and OPT_UNSET to an enum > which keeps track of how a given option got parsed. The case of "0" > was an implicit OPT_LONG, so let's add an explicit label for it.
I think this is going backwards. If we want to change anything in this area, you may
(1) spell the values not as 1 and 2 but as bit-shifts (1U<<0),
(1U<<1), and(2) turn "flags" into "unsigned".
but I do not think of a reason why it would be a good move to use enum for "these are bits", for the same reason as my comments on [2/10].
Thanks.