Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Improve CMEDB HELP after loosing too much time with workspace .. #652

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cme/cmedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ def do_proto(self, proto):
pass

def do_workspace(self, line):
helpString = "[-] wordkspace create <targetName> | workspace list | workspace <targetName>"
if not line:
print(helpString)
return

line = line.strip()
Expand Down Expand Up @@ -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)
Expand Down