Repository navigation
Expand file tree
/
Copy pathhelp.py
More file actions
56 lines (47 loc) · 2 KB
/
Copy pathhelp.py
File metadata and controls
56 lines (47 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from prompt_toolkit import print_formatted_text
from prompt_toolkit.formatted_text import FormattedText
from utils.color_palette import ColorSelected
def show_help(extra= None):
help_command = '''
Core commands
=============
Command Description
------- -----------
help Help menu
load <module> Load module
modules [category] List all modules or a certain category
find <info> Search modules with concret info
exit|quit Exit application
banner Show banner
export Save global options
import Load global options (previously exported)
tasks <show/kill> [id] Show tasks running or kill a task
theme dark|light|default Change the theme of the tool
# <command> Grant terminal commands
'''
help_command += '''
Module commands
===============
Command Description
------- -----------
set <option> <value> Set value for module's option
unset <option> Unset value for module's option
run Run module
back Unload module
show [options|info] Show either options or info
global <option> <value> Set global option
'''
if extra:
help_command += f"""
Additional feature
==================
Command Description
------- -----------"""
for k, v in extra.items():
if len(k) > 26:
k = k[:22] + "..."
help_command += f"""
{str(k).ljust(26)} {v}"""
print("\n")
text = FormattedText([(f'{ColorSelected().theme.text}', help_command)])
print_formatted_text(text)