mirror of
https://github.com/ytisf/theZoo.git
synced 2026-02-20 13:50:45 +00:00
Merge pull request #14 from 5Fingers/patch-2
Update terminal_handler.py
This commit is contained in:
@@ -1,12 +1,14 @@
|
|||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
import rlcompleter
|
||||||
|
import readline
|
||||||
|
|
||||||
|
|
||||||
import globals
|
import globals
|
||||||
from imports import manysearches
|
from imports import manysearches
|
||||||
from imports.update_handler import Updater
|
from imports.update_handler import Updater
|
||||||
from imports import db_handler
|
from imports import db_handler
|
||||||
|
|
||||||
|
|
||||||
class Controller:
|
class Controller:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -22,6 +24,8 @@ class Controller:
|
|||||||
("help", "Displays this help..."),
|
("help", "Displays this help..."),
|
||||||
("exit", "Exits...")]
|
("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..."),
|
self.searchmeth = [("arch", "which architecture etc; x86, x64, arm7 so on..."),
|
||||||
("plat",
|
("plat",
|
||||||
"platform: win32, win64, mac, android so on..."),
|
"platform: win32, win64, mac, android so on..."),
|
||||||
@@ -29,10 +33,15 @@ class Controller:
|
|||||||
("vip", "1 or 0")]
|
("vip", "1 or 0")]
|
||||||
|
|
||||||
self.modules = self.GetPayloads()
|
self.modules = self.GetPayloads()
|
||||||
|
completer = Completer(self.commandsWithoutDiscription)
|
||||||
|
|
||||||
|
readline.parse_and_bind("tab: complete")
|
||||||
|
readline.set_completer(completer.complete)
|
||||||
|
|
||||||
def GetPayloads(self):
|
def GetPayloads(self):
|
||||||
return self.db.get_full_details()
|
return self.db.get_full_details()
|
||||||
|
|
||||||
|
|
||||||
def MainMenu(self):
|
def MainMenu(self):
|
||||||
# This will give you the nice prompt you like so much
|
# This will give you the nice prompt you like so much
|
||||||
if len(self.currentmodule) > 0:
|
if len(self.currentmodule) > 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user