diff options
author | okan <okan> | 2015-06-30 18:54:12 +0000 |
---|---|---|
committer | okan <okan> | 2015-06-30 18:54:12 +0000 |
commit | 5d8027b75d20174446aa3788f856280aae7dd622 (patch) | |
tree | a0230c6d61bf70a94cc64bfb5c0b0deacd63fea1 /search.c | |
parent | c87953eb647c360cef8834c381bd22de4a0b524b (diff) | |
download | cwm-5d8027b75d20174446aa3788f856280aae7dd622.tar.gz cwm-5d8027b75d20174446aa3788f856280aae7dd622.tar.xz cwm-5d8027b75d20174446aa3788f856280aae7dd622.zip |
Introduce a callback for cmd menu printing, special-casing 'lock' and
'term'.
Diffstat (limited to 'search.c')
-rw-r--r-- | search.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/search.c b/search.c index edb3421..9013a9d 100644 --- a/search.c +++ b/search.c @@ -124,6 +124,20 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search) } void +search_print_cmd(struct menu *mi, int i) +{ + struct cmd *cmd = (struct cmd *)mi->ctx; + int special = 0; + + if ((strcmp(cmd->name, "lock") == 0) || + (strcmp(cmd->name, "term") == 0)) + special = 1; + + (void)snprintf(mi->print, sizeof(mi->print), + (special) ? "[%s]" : "%s", cmd->name); +} + +void search_print_client(struct menu *mi, int list) { struct client_ctx *cc = (struct client_ctx *)mi->ctx; |