Update terminal_handler.py

Created the auto-completer :)
This commit is contained in:
5Fingers
2015-01-08 23:57:55 +02:00
parent 81e6e789f4
commit 1c0ba73982

View File

@@ -1,12 +1,14 @@
import sys
import re
import rlcompleter
import readline
import globals
from imports import manysearches
from imports.update_handler import Updater
from imports import db_handler
class Controller:
def __init__(self):
@@ -22,6 +24,8 @@ class Controller:
("help", "Displays this help..."),
("exit", "Exits...")]
self.commandsWithoutDiscription = ['search', 'list all', 'use', 'get', 'report-mal', 'update-db', 'help', 'exit']
self.searchmeth = [("arch", "which architecture etc; x86, x64, arm7 so on..."),
("plat",
"platform: win32, win64, mac, android so on..."),
@@ -29,10 +33,15 @@ class Controller:
("vip", "1 or 0")]
self.modules = self.GetPayloads()
completer = Completer(self.commandsWithoutDiscription)
readline.parse_and_bind("tab: complete")
readline.set_completer(completer.complete)
def GetPayloads(self):
return self.db.get_full_details()
def MainMenu(self):
# This will give you the nice prompt you like so much
if len(self.currentmodule) > 0: