Skip to content

Commit cd87ce7

Browse files
avargitster
authored andcommitted
help.c: use puts() instead of printf{,_ln}() for consistency
Change code in "help.c" that used printf_ln() without format specifiers to use puts() instead, as other existing code in the file does. Let's also change related code to use puts() instead of the equivalent of calling "printf" with a "%s\n" format. This formatting-only change will make a subsequent functional change easier to read, as it'll be changing code that's consistently using the same functions to do the same things. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4bf5cda commit cd87ce7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

help.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ static void print_cmd_by_category(const struct category_description *catdesc,
124124
uint32_t mask = catdesc[i].category;
125125
const char *desc = catdesc[i].desc;
126126

127-
printf("\n%s\n", _(desc));
127+
putchar('\n');
128+
puts(_(desc));
128129
print_command_list(cmds, mask, longest);
129130
}
130131
free(cmds);
@@ -317,7 +318,7 @@ void list_commands(struct cmdnames *main_cmds, struct cmdnames *other_cmds)
317318
}
318319

319320
if (other_cmds->cnt) {
320-
printf_ln(_("git commands available from elsewhere on your $PATH"));
321+
puts(_("git commands available from elsewhere on your $PATH"));
321322
putchar('\n');
322323
pretty_print_cmdnames(other_cmds, colopts);
323324
putchar('\n');
@@ -439,7 +440,7 @@ void list_all_cmds_help(void)
439440
struct cmdname_help *aliases;
440441
int i, longest;
441442

442-
printf_ln(_("See 'git help <command>' to read about a specific subcommand"));
443+
puts(_("See 'git help <command>' to read about a specific subcommand"));
443444
print_cmd_by_category(main_categories, &longest);
444445

445446
list_all_other_cmds(&others);

0 commit comments

Comments
 (0)