Browse Source

added session log to view your sessions

pull/357/head
xssdoctor 7 months ago
parent
commit
b5ee3d38a3
  1. 6
      installer/client/cli/fabric.py
  2. 6
      installer/client/cli/helper.py

6
installer/client/cli/fabric.py

@ -31,6 +31,7 @@ def main():
parser.add_argument('--session', '-S',
help="Continue your previous conversation. Default is your previous conversation", nargs="?", const="default")
parser.add_argument('--clearsession', help="deletes indicated session. Use 'all' to delete all dessions")
parser.add_argument('--sessionlog', help="View the log of a session")
parser.add_argument(
"--gui", help="Use the GUI (Node and npm need to be installed)", action="store_true")
parser.add_argument(
@ -133,6 +134,11 @@ def main():
else:
print(f"Session {args.clearsession} cleared")
sys.exit()
if args.sessionlog:
from .helper import Session
session = Session()
print(session.session_log(args.sessionlog))
sys.exit()
standalone = Standalone(args, args.pattern)
if args.list:
try:

6
installer/client/cli/helper.py

@ -49,3 +49,9 @@ class Session:
os.remove(os.path.join(self.sessions_folder, file))
else:
os.remove(os.path.join(self.sessions_folder, session))
def session_log(self, session):
file = os.path.join(self.sessions_folder, session)
if not os.path.exists(file):
return None
with open(file, "r") as f:
return f.read()

Loading…
Cancel
Save