diff options
Diffstat (limited to 'wm/dmenu-5.3/dmenu.c')
| -rw-r--r-- | wm/dmenu-5.3/dmenu.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/wm/dmenu-5.3/dmenu.c b/wm/dmenu-5.3/dmenu.c index 504487c..8ce8aac 100644 --- a/wm/dmenu-5.3/dmenu.c +++ b/wm/dmenu-5.3/dmenu.c @@ -306,6 +306,13 @@ match(void) matchend = substrend; } curr = sel = matches; + + if (instant && matches && matches==matchend && !lsubstr) { + puts(matches->text); + cleanup(); + exit(0); + } + calcoffsets(); } @@ -789,7 +796,9 @@ main(int argc, char *argv[]) else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */ fstrncmp = strncasecmp; fstrstr = cistrstr; - } else if (i + 1 == argc) + } else if (!strcmp(argv[i], "-n")) /* instant select only match */ + instant = 1; + else if (i + 1 == argc) usage(); /* these options take one argument */ else if (!strcmp(argv[i], "-g")) { /* number of columns in grid */ |