From 5c5bb9a02f735620d4e5fb2e135f32e83e962bfb Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Fri, 13 Dec 2013 20:55:28 +0000 Subject: [PATCH] Add basic run command --- plum/cli/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plum/cli/main.py b/plum/cli/main.py index 9f18f8ffd..6985b1fef 100644 --- a/plum/cli/main.py +++ b/plum/cli/main.py @@ -64,6 +64,7 @@ class TopLevelCommand(Command): Commands: ps List services and containers + run Run a one-off command start Start services stop Stop services @@ -78,6 +79,15 @@ class TopLevelCommand(Command): for container in service.containers: print container['Names'][0] + def run(self, options): + """ + Run a one-off command. + + Usage: run SERVICE COMMAND [ARGS...] + """ + service = self.service_collection.get(options['SERVICE']) + service.start_container(command=[options['COMMAND']] + options['ARGS']) + def start(self, options): """ Start all services