Skip to content

Commit be54eaf

Browse files
committed
rename command_clean() to command_free()
1 parent 18fee5c commit be54eaf

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/commander.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ command_init(command_t *self, const char *name, const char *version) {
7070
}
7171

7272
/*
73-
* Clean up the command after use.
73+
* Free up commander after use.
7474
*/
7575

7676
void
77-
command_clean(command_t *self) {
77+
command_free(command_t *self) {
7878
for (int i = 0; i < self->option_count; ++i) {
7979
command_option_t *option = &self->options[i];
8080
free(option->argname);

src/commander.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void
7474
command_init(command_t *self, const char *name, const char *version);
7575

7676
void
77-
command_clean(command_t *self);
77+
command_free(command_t *self);
7878

7979
void
8080
command_help(command_t *self);
@@ -85,4 +85,4 @@ command_option(command_t *self, const char *small, const char *large, const char
8585
void
8686
command_parse(command_t *self, int argc, char **argv);
8787

88-
#endif /* COMMANDER_H */
88+
#endif /* COMMANDER_H */

test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ main(int argc, char **argv){
2929
for (int i = 0; i < cmd.argc; ++i) {
3030
printf(" - '%s'\n", cmd.argv[i]);
3131
}
32-
command_clean(&cmd);
32+
command_free(&cmd);
3333
return 0;
34-
}
34+
}

0 commit comments

Comments
 (0)