diff options
author | B. Watson <yalhcru@gmail.com> | 2021-06-21 16:01:46 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2021-06-21 16:01:46 -0400 |
commit | 1d3367359a20bf720388ec92fb11b3ebc67cfe8e (patch) | |
tree | a6649374f860fd3b9a09a0e84745983d299c80b9 /SlackTools | |
parent | 4e2cdbe60fa5fab8925d815aa3d05c728ef9a314 (diff) | |
download | limnoria.slackfacts.plugins-1d3367359a20bf720388ec92fb11b3ebc67cfe8e.tar.gz |
SlackTools: make !filesearch auto-globbing unless given an absolute path
Diffstat (limited to 'SlackTools')
-rw-r--r-- | SlackTools/plugin.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/SlackTools/plugin.py b/SlackTools/plugin.py index f6c0484..26b63ab 100644 --- a/SlackTools/plugin.py +++ b/SlackTools/plugin.py @@ -118,6 +118,8 @@ class SlackTools(callbacks.Plugin): cursor.execute("select c.name, p.name, p.descrip from categories c, packages p where c.id=p.category and p.category=? and lower(p.name) glob ? order by c.name, p.name limit ?", (category, term, maxresults+1)) # file search (no way to specify category) else: + if(term[:1] != '/'): + term = '*' + term + '*' cursor.execute("select distinct c.name, p.name, p.descrip from categories c, packages p, files f where c.id=p.category and p.id=f.package and f.path glob ? order by c.name, p.name limit ?", (term, maxresults+1)) result = cursor.fetchall() |