From: Jonathan Nieder Date: Sat, 26 Jul 2008 18:28:39 GMT Subject: Re: [PATCH 3/7] builtin-help: make list_commands() a bit more generic Message-ID: In-Reply-To: <68749731fe8de8b2a9ffc53963291aeab9256b82.1217037178.git.vmiklos@frugalware.org> On Sat, 26 Jul 2008, Miklos Vajna wrote: > -static void list_commands(void) > +void list_commands(const char *prefix, const char *title) > { > - unsigned int longest = load_command_list(NULL); > + unsigned int longest = load_command_list(prefix); > const char *exec_path = git_exec_path(); > > if (main_cmds.cnt) { > - printf("available git commands in '%s'\n", exec_path); > + printf("available %s in '%s'\n", title, exec_path); > printf("----------------------------"); > mput_char('-', strlen(exec_path)); > putchar('\n'); Should this be printf("available %s in '%s'\n", title, exec_path); printf("----------------"); mput_char('-', strlen(exec_path) + strlen(title)); putchar('\n'); ? (same question goes for the if(other_cmds.cnt) block, too)