]> git.ipfire.org Git - thirdparty/git.git/commit
am: simplify parsing of "--[no-]keep-cr"
authorJunio C Hamano <gitster@pobox.com>
Tue, 18 Jul 2023 18:22:40 +0000 (11:22 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Jul 2023 19:19:31 +0000 (12:19 -0700)
commit947ebd62a0cc830b00f106f6fa5f0715674990a2
treec192f58a199a8f4d33215f489d4b6e88ed3f734a
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3
am: simplify parsing of "--[no-]keep-cr"

Command line options "--keep-cr" and its negation trigger
OPT_SET_INT_F(PARSE_OPT_NONEG) to set a variable to 1 and 0
respectively.  Using OPT_SET_INT() to implement the positive variant
that sets the variable to 1 without specifying PARSE_OPT_NONEG gives
us the negative variant to set it to 0 for free.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c