From bdd696b04fa7703463661166a1cb98e4f5e15c2a Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Fri, 13 Jun 2025 12:09:12 +0800 Subject: [PATCH] fix: restore K&R coding style and correct return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix switch-case indentation to follow K&R style (align case labels with switch) - Replace EXIT_SUCCESS with 0 in non-exit function argparse_help_cb_no_exit() - EXIT_SUCCESS should only be used with exit() or returned by main() Fixes #74 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- argparse.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/argparse.c b/argparse.c index 79c025ae..f3bfe17a 100644 --- a/argparse.c +++ b/argparse.c @@ -130,17 +130,17 @@ argparse_options_check(const struct argparse_option *options) { for (; options->type != ARGPARSE_OPT_END; options++) { switch (options->type) { - case ARGPARSE_OPT_END: - case ARGPARSE_OPT_BOOLEAN: - case ARGPARSE_OPT_BIT: - case ARGPARSE_OPT_INTEGER: - case ARGPARSE_OPT_FLOAT: - case ARGPARSE_OPT_STRING: - case ARGPARSE_OPT_GROUP: - continue; - default: - fprintf(stderr, "wrong option type: %d", options->type); - break; + case ARGPARSE_OPT_END: + case ARGPARSE_OPT_BOOLEAN: + case ARGPARSE_OPT_BIT: + case ARGPARSE_OPT_INTEGER: + case ARGPARSE_OPT_FLOAT: + case ARGPARSE_OPT_STRING: + case ARGPARSE_OPT_GROUP: + continue; + default: + fprintf(stderr, "wrong option type: %d", options->type); + break; } } } @@ -383,7 +383,7 @@ argparse_help_cb_no_exit(struct argparse *self, { (void)option; argparse_usage(self); - return (EXIT_SUCCESS); + return 0; } int