summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-04-25 18:21:53 +0700
committerJunio C Hamano <gitster@pobox.com>2012-04-25 10:30:11 -0700
commit4470ef94973cf40bb83864d480cee1e064053879 (patch)
treefd5bb4c44bbd82f81a9c17f7913bad6cc23d365f /help.c
parent8a1e7eac689c53f15d986e8525484ca9bd640553 (diff)
downloadgit-4470ef94973cf40bb83864d480cee1e064053879.tar.gz
help: replace underlining "help -a" headers using hyphens with a blank line
We used to underline a header text, like this: This is a header ---------------- content... But calculating text length so that the dashes align with the text could get complicated because the text could be in any charset in translated Git. There is no point to use this pseudo underline; simply a blank line would do and it even makes it easier to read: This is a header content... While at it, give translators more context to translate, e.g. e.g. "git commands available..." instead of "%s available..." Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'help.c')
-rw-r--r--help.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/help.c b/help.c
index 9e6e0f2ab7..a39b7bf897 100644
--- a/help.c
+++ b/help.c
@@ -203,8 +203,7 @@ void load_command_list(const char *prefix,
exclude_cmds(other_cmds, main_cmds);
}
-void list_commands(const char *title, struct cmdnames *main_cmds,
- struct cmdnames *other_cmds)
+void list_commands(struct cmdnames *main_cmds, struct cmdnames *other_cmds)
{
int i, longest = 0;
@@ -217,23 +216,14 @@ void list_commands(const char *title, struct cmdnames *main_cmds,
if (main_cmds->cnt) {
const char *exec_path = git_exec_path();
- printf_ln(_("available %s in '%s'"), title, exec_path);
- /* TRANSLATORS: this must align with "available %s in '%s'" */
- printf(_("----------------"));
- mput_char('-', strlen(title) + strlen(exec_path));
+ printf_ln(_("available git commands in '%s'"), exec_path);
putchar('\n');
pretty_print_string_list(main_cmds, longest);
putchar('\n');
}
if (other_cmds->cnt) {
- printf_ln(_("%s available from elsewhere on your $PATH"), title);
- /* TRANSLATORS:
- * this must align with
- * "%s available from elsewhere on your $PATH"
- */
- printf(_("---------------------------------------"));
- mput_char('-', strlen(title));
+ printf_ln(_("git commands available from elsewhere on your $PATH"));
putchar('\n');
pretty_print_string_list(other_cmds, longest);
putchar('\n');