mirror of
https://github.com/ytisf/theZoo.git
synced 2025-12-05 20:19:57 -08:00
Update terminal_handler.py
Created the auto-completer :)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user