Skip to content

Commit 0116f45

Browse files
committed
created a command to view the version number from inside the terminal (issue #611)
1 parent a7d9ce5 commit 0116f45

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

lib/banner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import random
33

4-
VERSION = "3.0.2"
4+
VERSION = "3.0.3"
55

66

77
def banner_1(line_sep="#--", space=" " * 30):

lib/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def complete_text(self, text, state):
5454
personal/custom Load a custom host file
5555
tokens/reset Reset API tokens if needed
5656
external View loaded external commands
57+
ver[sion] View the current version of the program
5758
help/? Display this help
5859
"""
5960

lib/term/terminal.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import datetime
33

4+
import lib.banner
45
import lib.settings
56
import lib.output
67
import lib.errors
@@ -42,6 +43,8 @@ class object for the main terminal of the program
4243
"external",
4344
# reset API tokens
4445
"reset", "tokens",
46+
# show the version number
47+
"ver", "version",
4548
# easter eggs!
4649
"idkwhatimdoing", "ethics", "skid"
4750
]
@@ -127,6 +130,12 @@ def get_choice(self):
127130
retval = ("unknown", original_choice)
128131
return retval
129132

133+
def do_show_version_number(self):
134+
"""
135+
display the current version number
136+
"""
137+
lib.output.info("your current version number: {}".format(lib.banner.VERSION))
138+
130139
def do_display_external(self):
131140
"""
132141
display all external commands
@@ -462,6 +471,8 @@ def terminal_main_display(self, tokens, extra_commands=None, save_history=True):
462471
self.do_quit_terminal(save_history=save_history)
463472
elif any(c in choice for c in ("view", "gathered")):
464473
self.do_view_gathered()
474+
elif any(c in choice for c in ("ver", "version")):
475+
self.do_show_version_number()
465476
elif "single" in choice:
466477
if "help" in choice_data_list:
467478
print(self.do_add_single_host.__doc__)

0 commit comments

Comments
 (0)