From 245a861d71c9dfa5a3107614dc158ad599fcae10 Mon Sep 17 00:00:00 2001 From: Roger Binns Date: Thu, 12 Dec 2024 16:50:15 -0800 Subject: [PATCH] More trying to get .pages-svg to complete It still fails because readline doesn't believe - can be part of a token, and it isn't worth rewriting all the completion to make this one case work --- apsw/shell.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apsw/shell.py b/apsw/shell.py index 78ca68e7..32bcf3f9 100644 --- a/apsw/shell.py +++ b/apsw/shell.py @@ -3268,7 +3268,7 @@ def complete(self, token, state): def _get_prev_tokens(self, line, end): "Returns the tokens prior to pos end in the line" - return re.findall(r'"?\w+"?', line[:end]) + return re.findall(r'"?[\-\w]+"?', line[:end]) def complete_sql(self, line, token, beg, end): """Provide some completions for SQL @@ -3419,7 +3419,9 @@ def complete_command(self, line, token, beg, end): """ if not self._builtin_commands: self._builtin_commands = [ - "." + x[len("command_") :] for x in dir(self) if x.startswith("command_") and x != "command_headers" + "." + x[len("command_") :].replace("_", "-") + for x in dir(self) + if x.startswith("command_") and x != "command_headers" ] t = self._get_prev_tokens(line, end)