Skip to content

Commit 5559200

Browse files
cofycclaude
andauthored
fix: restore K&R coding style and correct return value (#75)
- 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 <noreply@anthropic.com>
1 parent 16b2ba6 commit 5559200

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

argparse.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,17 @@ argparse_options_check(const struct argparse_option *options)
130130
{
131131
for (; options->type != ARGPARSE_OPT_END; options++) {
132132
switch (options->type) {
133-
case ARGPARSE_OPT_END:
134-
case ARGPARSE_OPT_BOOLEAN:
135-
case ARGPARSE_OPT_BIT:
136-
case ARGPARSE_OPT_INTEGER:
137-
case ARGPARSE_OPT_FLOAT:
138-
case ARGPARSE_OPT_STRING:
139-
case ARGPARSE_OPT_GROUP:
140-
continue;
141-
default:
142-
fprintf(stderr, "wrong option type: %d", options->type);
143-
break;
133+
case ARGPARSE_OPT_END:
134+
case ARGPARSE_OPT_BOOLEAN:
135+
case ARGPARSE_OPT_BIT:
136+
case ARGPARSE_OPT_INTEGER:
137+
case ARGPARSE_OPT_FLOAT:
138+
case ARGPARSE_OPT_STRING:
139+
case ARGPARSE_OPT_GROUP:
140+
continue;
141+
default:
142+
fprintf(stderr, "wrong option type: %d", options->type);
143+
break;
144144
}
145145
}
146146
}
@@ -383,7 +383,7 @@ argparse_help_cb_no_exit(struct argparse *self,
383383
{
384384
(void)option;
385385
argparse_usage(self);
386-
return (EXIT_SUCCESS);
386+
return 0;
387387
}
388388

389389
int

0 commit comments

Comments
 (0)