test-parse-options.c: fix style of comparison with zero

The preferred style is '!argc' instead of 'argc == 0'.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
SZEDER Gábor 2022-09-05 20:50:05 +02:00 committed by Junio C Hamano
parent 6983f4e3b2
commit 45bec2ead2

View file

@ -255,7 +255,7 @@ int cmd__parse_options_flags(int argc, const char **argv)
argc = parse_options(argc, argv, NULL, test_flag_options, usage,
PARSE_OPT_STOP_AT_NON_OPTION);
if (argc == 0 || strcmp(argv[0], "cmd")) {
if (!argc || strcmp(argv[0], "cmd")) {
error("'cmd' is mandatory");
usage_with_options(usage, test_flag_options);
}
@ -313,7 +313,7 @@ int cmd__parse_subcommand(int argc, const char **argv)
argc = parse_options(argc, argv, NULL, test_flag_options, usage,
PARSE_OPT_STOP_AT_NON_OPTION);
if (argc == 0 || strcmp(argv[0], "cmd")) {
if (!argc || strcmp(argv[0], "cmd")) {
error("'cmd' is mandatory");
usage_with_options(usage, test_flag_options);
}