Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 406f2cd

Browse files
committed
Got rid of useless TAB completion in --sql-shell
1 parent 35ce6de commit 406f2cd

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

lib/core/shell.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ def loadHistory():
3333
warnMsg = "there was a problem loading the history file '%s' (%s)" % (historyPath, msg)
3434
logger.warn(warnMsg)
3535

36-
def queriesForAutoCompletion():
37-
autoComplQueries = {}
38-
39-
for item in queries[Backend.getIdentifiedDbms()]._toflat():
40-
if item._has_key('query') and len(item.query) > 1 and item._name != 'blind':
41-
autoComplQueries[item.query] = None
42-
43-
return autoComplQueries
44-
4536
class CompleterNG(rlcompleter.Completer):
4637
def global_matches(self, text):
4738
"""
@@ -66,9 +57,7 @@ def autoCompletion(sqlShell=False, osShell=False):
6657
if not readline._readline:
6758
return
6859

69-
if sqlShell:
70-
completer = CompleterNG(queriesForAutoCompletion())
71-
elif osShell:
60+
if osShell:
7261
if Backend.isOs(OS.WINDOWS):
7362
# Reference: http://en.wikipedia.org/wiki/List_of_DOS_commands
7463
completer = CompleterNG({
@@ -87,8 +76,8 @@ def autoCompletion(sqlShell=False, osShell=False):
8776
"pwd": None, "uname": None, "id": None,
8877
})
8978

90-
readline.set_completer(completer.complete)
91-
readline.parse_and_bind("tab: complete")
79+
readline.set_completer(completer.complete)
80+
readline.parse_and_bind("tab: complete")
9281

9382
loadHistory()
9483
atexit.register(saveHistory)

0 commit comments

Comments
 (0)