mirror of
https://github.com/Cronocide/wifipumpkin3.git
synced 2025-01-23 11:48:57 +00:00
added description change to tabulate info modules
This commit is contained in:
parent
e0c2786694
commit
23c5be6378
@ -4,6 +4,7 @@ from wifipumpkin3.core.utility.collection import SettingsINI
|
|||||||
import wifipumpkin3.core.utility.constants as C
|
import wifipumpkin3.core.utility.constants as C
|
||||||
from os import popen
|
from os import popen
|
||||||
import sys
|
import sys
|
||||||
|
from tabulate import tabulate
|
||||||
|
|
||||||
class ConsoleUI(Cmd):
|
class ConsoleUI(Cmd):
|
||||||
''' shell console UI '''
|
''' shell console UI '''
|
||||||
@ -171,7 +172,7 @@ class ModuleUI(Cmd):
|
|||||||
if (command in self.options.keys()):
|
if (command in self.options.keys()):
|
||||||
#self.conf.set('accesspoint',self.commands[command],value)
|
#self.conf.set('accesspoint',self.commands[command],value)
|
||||||
print(display_messages('changed to {} => {}'.format(command, value),sucess=True))
|
print(display_messages('changed to {} => {}'.format(command, value),sucess=True))
|
||||||
self.options.update({command: value})
|
self.options[command] = [value, self.options[command][1]]
|
||||||
else:
|
else:
|
||||||
print(display_messages('unknown command: {} '.format(command),error=True))
|
print(display_messages('unknown command: {} '.format(command),error=True))
|
||||||
print(display_messages("Example : set host 127.0.0.1", info=True))
|
print(display_messages("Example : set host 127.0.0.1", info=True))
|
||||||
@ -180,11 +181,11 @@ class ModuleUI(Cmd):
|
|||||||
|
|
||||||
def do_options(self, line):
|
def do_options(self, line):
|
||||||
""" show options of current module"""
|
""" show options of current module"""
|
||||||
print(display_messages('Available Options:',info=True,sublime=True))
|
headers_table, output_table = ["Option", "Value", "Description"], []
|
||||||
self.stdout.write(' {} {}\n'.format('Option', 'Value'))
|
|
||||||
self.stdout.write(' {} {}\n'.format('------', '-----'))
|
|
||||||
for option,value in self.options.items():
|
for option,value in self.options.items():
|
||||||
self.stdout.write(' {:<10} {}\n'.format(option, value))
|
output_table.append([option,value[0], value[1]])
|
||||||
|
print(display_messages('Available Options:',info=True,sublime=True))
|
||||||
|
print(tabulate(output_table, headers_table,tablefmt="simple"))
|
||||||
print("\n")
|
print("\n")
|
||||||
|
|
||||||
def do_help(self,args):
|
def do_help(self,args):
|
||||||
|
@ -17,8 +17,8 @@ class ModPump(ModuleUI):
|
|||||||
name = "wifiscan"
|
name = "wifiscan"
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
"interface": "wlxc83a35cef744",
|
"interface": ["wlxc83a35cef744", "Name network interface wireless "],
|
||||||
"timeout": 10
|
"timeout": [10, "Time duration of scan network wireless (ex: 0 infinty)"]
|
||||||
}
|
}
|
||||||
completions = list(options.keys())
|
completions = list(options.keys())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user