summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7e82d90)
raw | patch | inline | side by side (parent: 7e82d90)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 28 Jan 2009 18:30:17 +0000 (19:30 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 28 Jan 2009 18:37:15 +0000 (19:37 +0100) |
tig.c | patch | blob | history |
index 32f5c7c21499196ff4371a9b83b091536a994cb5..b951c64c87a5345c9093efad14956b3f4c27d051 100644 (file)
--- a/tig.c
+++ b/tig.c
static bool
help_open(struct view *view)
{
+ char buf[SIZEOF_STR];
+ size_t bufpos;
int i;
if (view->lines > 0)
if (!*key)
key = "(no key defined)";
- add_line_format(view, LINE_DEFAULT, " %-25s %s",
- key, req_info[i].help);
+ for (bufpos = 0; bufpos <= req_info[i].namelen; bufpos++) {
+ buf[bufpos] = tolower(req_info[i].name[bufpos]);
+ if (buf[bufpos] == '_')
+ buf[bufpos] = '-';
+ }
+
+ add_line_format(view, LINE_DEFAULT, " %-25s %-20s %s",
+ key, buf, req_info[i].help);
}
if (run_requests) {
for (i = 0; i < run_requests; i++) {
struct run_request *req = get_run_request(REQ_NONE + i + 1);
const char *key;
- char cmd[SIZEOF_STR];
- size_t bufpos;
int argc;
if (!req)
key = "(no key defined)";
for (bufpos = 0, argc = 0; req->argv[argc]; argc++)
- if (!string_format_from(cmd, &bufpos, "%s%s",
+ if (!string_format_from(buf, &bufpos, "%s%s",
argc ? " " : "", req->argv[argc]))
return REQ_NONE;
add_line_format(view, LINE_DEFAULT, " %-10s %-14s `%s`",
- keymap_table[req->keymap].name, key, cmd);
+ keymap_table[req->keymap].name, key, buf);
}
return TRUE;