diff options
author | Gustav HÃ¥llberg <gustav@gmail.com> | 2009-01-01 01:59:11 (GMT) |
---|---|---|
committer | Gustav HÃ¥llberg <gustav@gmail.com> | 2009-01-16 23:38:32 (GMT) |
commit | 946b7deef9b5910f0e89b36a6110b8d3c6ef5fd4 (patch) | |
tree | aab106555ff8bfad4fdbc3227740edaee8d7d02d | |
parent | 05209528cad427d4df322bde20f1662196e762e4 (diff) | |
download | powwow-946b7deef9b5910f0e89b36a6110b8d3c6ef5fd4.zip powwow-946b7deef9b5910f0e89b36a6110b8d3c6ef5fd4.tar.gz powwow-946b7deef9b5910f0e89b36a6110b8d3c6ef5fd4.tar.bz2 |
set better $TITLE when viewing help texts
-rw-r--r-- | cmd.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -432,11 +432,14 @@ static void cmd_help __P1 (char *,arg) fclose(f); return; } - - memcpy(text, line, i = strlen(line)); - while (fgets(line, BUFSIZE, f) && line[0] == '@') - ; /* allow multiple commands to share the same help */ + /* the first line becomes $TITLE */ + tmp = strchr(line, '\n'); + if (tmp) *tmp = '\0'; + i = sprintf(text, "Help on '%s'\n", line + 1); + + /* allow multiple commands to share the same help */ + while (fgets(line, BUFSIZE, f) && line[0] == '@') ; do { if ((len = strlen(line)) >= size - i) { |