From 590b236c45d6089054b26923f63e9942c4d029f6 Mon Sep 17 00:00:00 2001 From: shoxxdj Date: Tue, 18 Oct 2022 22:22:17 +0200 Subject: [PATCH] :rocket: Improve CMEDB after loosing too much time with workspace .. --- cme/cmedb.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cme/cmedb.py b/cme/cmedb.py index bcf1c0d6..8f3d8dcf 100644 --- a/cme/cmedb.py +++ b/cme/cmedb.py @@ -328,7 +328,9 @@ def do_proto(self, proto): pass def do_workspace(self, line): + helpString = "[-] wordkspace create | workspace list | workspace " if not line: + print(helpString) return line = line.strip() @@ -364,12 +366,24 @@ def do_workspace(self, line): self.do_workspace(new_workspace) + elif line.split()[0] == 'list': + print("[*] Enumerating Workspaces") + for workspace in os.listdir(os.path.join(self.workspace_dir)): + if(workspace==self.workspace): + print("==> "+workspace) + else: + print(workspace) + elif os.path.exists(os.path.join(self.workspace_dir, line)): self.config.set('CME', 'workspace', line) self.write_configfile() self.workspace = line self.prompt = 'cmedb ({}) > '.format(line) + + else: + print(helpString) + def do_exit(self, line): sys.exit(0)