From f9ab4a3b9876da73a7da8f6eb929cfca7d8315e9 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Sun, 1 Dec 2019 21:20:18 -0500 Subject: [PATCH] clarified when container was created, added status --- cli50/__main__.py | 10 +++++----- setup.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli50/__main__.py b/cli50/__main__.py index cf4b24b..f296e91 100644 --- a/cli50/__main__.py +++ b/cli50/__main__.py @@ -89,7 +89,7 @@ def main(): "docker", "ps", "--all", "--filter", "status=running", - "--format", "{{.ID}}\t{{.Image}}\t{{.RunningFor}}\t{{.Mounts}}", + "--format", "{{.ID}}\t{{.Image}}\t{{.RunningFor}}\t{{.Status}}\t{{.Mounts}}", "--no-trunc" ]).decode("utf-8") except subprocess.CalledProcessError: @@ -97,17 +97,17 @@ def main(): else: containers = [] for line in stdout.rstrip().splitlines(): - ID, Image, RunningFor, *Mounts = line.split("\t") + ID, Image, RunningFor, Status, *Mounts = line.split("\t") Mounts = Mounts[0].split(",") if Mounts else [] Mounts = [Mount for Mount in Mounts if not re.match(r"^[0-9a-fA-F]{64}$", Mount)] # Ignore hashes - containers.append((ID, Image, RunningFor.lower(), Mounts)) + containers.append((ID, Image, RunningFor.lower(), Status.lower(), Mounts)) if not containers: sys.exit("No containers are running.") # Ask whether to use a running container - for ID, Image, RunningFor, Mounts in containers: + for ID, Image, RunningFor, Status, Mounts in containers: while True: - prompt = _("Log into {}, started {}").format(Image, RunningFor) + prompt = _("Log into {}, created {}, {},").format(Image, RunningFor, Status) if Mounts: prompt += _(" with {} mounted").format(inflect.engine().join(Mounts)) prompt += "? [Y] " diff --git a/setup.py b/setup.py index 197cb85..291883e 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,6 @@ "console_scripts": ["cli50=cli50.__main__:main"] }, url="https://github.com/cs50/cli50", - version="3.5.1", + version="3.5.2", include_package_data=True )