1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Show command header in help output

This commit is contained in:
James Booth 2015-07-26 03:01:14 +01:00
parent 2b725f9144
commit bd32f4dc47

View File

@ -110,6 +110,14 @@ cons_show_help(Command *command)
{ {
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
cons_show("");
win_vprint(console, '-', NULL, 0, THEME_WHITE_BOLD, "", "%s", &command->cmd[1]);
win_print(console, '-', NULL, NO_EOL, THEME_WHITE_BOLD, "", "");
int i;
for (i = 0; i < strlen(command->cmd) - 1 ; i++) {
win_print(console, '-', NULL, NO_EOL | NO_DATE, THEME_WHITE_BOLD, "", "-");
}
win_print(console, '-', NULL, NO_DATE, THEME_WHITE_BOLD, "", "");
cons_show(""); cons_show("");
win_print(console, '-', NULL, 0, THEME_WHITE_BOLD, "", "Synopsis"); win_print(console, '-', NULL, 0, THEME_WHITE_BOLD, "", "Synopsis");
@ -119,7 +127,6 @@ cons_show_help(Command *command)
win_print(console, '-', NULL, 0, THEME_WHITE_BOLD, "", "Description"); win_print(console, '-', NULL, 0, THEME_WHITE_BOLD, "", "Description");
win_println(console, command->help.desc); win_println(console, command->help.desc);
int i;
int maxlen = 0; int maxlen = 0;
for (i = 0; command->help.args[i][0] != NULL; i++) { for (i = 0; command->help.args[i][0] != NULL; i++) {
if (strlen(command->help.args[i][0]) > maxlen) if (strlen(command->help.args[i][0]) > maxlen)