aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-06-21 16:01:46 -0400
committerB. Watson <yalhcru@gmail.com>2021-06-21 16:01:46 -0400
commit1d3367359a20bf720388ec92fb11b3ebc67cfe8e (patch)
treea6649374f860fd3b9a09a0e84745983d299c80b9
parent4e2cdbe60fa5fab8925d815aa3d05c728ef9a314 (diff)
downloadlimnoria.slackfacts.plugins-1d3367359a20bf720388ec92fb11b3ebc67cfe8e.tar.gz
SlackTools: make !filesearch auto-globbing unless given an absolute path
-rw-r--r--SlackTools/plugin.py2
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()